This project is read-only.

SnapShot3 crashing

Aug 12, 2015 at 5:05 PM
Edited Aug 26, 2015 at 10:37 PM
Hey guys, I've been looking into a bug in my program and it looks like it's a map window bug.

My C# program is simply loading a 1GB geotiff into my map then splitting it up into 4000x4000 pixel tiles that are exported as bitmaps. I'm using SnapShot3 to do this.

The problem looks like it occurs at line 531 in ImageDrawing.cpp in a part of the code that is padding the image to be 4 byte alligned. Creating the new padded array throws an exception. At the time this happens my process (as per the task manager) is using ~800MBs of RAM and the new array trying to be allocated would be 300MBs. As I understand a regular 32bit process should be able to handle 2GBs at the least so I'm not sure what the problem is here. Am I hitting some memory limit I don't know about?

I could possibly tweak the size of the tile I'm requesting to make sure that the resulting image never needs to be padded but these seems like a round-a-bout way of fixing the problem. Kinda looks like this could also happen during a regular redraw on a zoom event because I can also get it to crash the same way by just setting the map extents to my lat/lon bounds instead of calling the snapshot function.

Any insight would be much appreciated! Thanks!

EDIT: Turned out to be a process memory fragmentation problem. There was 1GB of free process memory but the biggest chunk was only 200MBs. In case anyone stumbles upon this, VMMap was a lifesaver to figuring this out. Video explaining it's use is here (