I have a memory intensive application loading and unloading large images that crashes due to Memory allocation failure.
I’d like to try the heap separation method to solve this. Set one area for images and another for all the rest which tend to be small objects.
I found windows API functions such as HeapAlloc\HeapCreate but I’m not sure this is the way to go. What’s the best way to tackle this?
I have used HeapAlloc\HeapCreate before with success, also for large objects (>20Mb I believe). But that was for keeping objects in separate heaps for debugging memory problems. In recent versions of windows the Low fragmentation heap should be the default. So I am surprised that you get yours to fragment. Maybe you suffer from this: LFH disabled? What is the largest size for a single allocation?