Is the latest version v3.0 update 2 commaligned release suppose to use about the same amount of memory as the crt malloc (which calls heapalloc)?
I'm still seeing very bad fragmentation problem with scalable_malloc / scalable_free - the same app when using malloc ends up with a peak memory (VM Size in Task Manager of XP) of 11MB but with scalable_malloc, it kept creeping up non-stop (I tested it up to 110MB before deciding it's not going to stop and killed it). TBB's allocator is being used in as a garbage collector's memory allocator - multiple garbage collector threads are responsible for deleting the garbage objects (which ends up calling scalable_free).
I understand the older version never released any memory back to the OS but the later versions seem to have changed that behavior. I do see this growing allocation of VM without releasing a bit of a problem for 32-bit systems where the 2GB boundary isn't very hard to blow out.
Additional info on the usage pattern - plenty of 32KB allocations that are not released until the GC kicks in. The GC is generational which means some of the 32KB allocations would not get released if it managed to get into the older generation when it survived a gen1 collection or when it's still being held by a reference. I can see this as a big problem for any allocators but winheap has no problems keeping the fragmentation low.
It's quite hard to write a test case to reproduce the problem seeing that the usage pattern is really complicated and would require a very carefully hand-crafted test case which is highly time-consuming with no guarantee of results. The only benchmark we had was Windows heapalloc, which released memory back to the OS with due diligence.
The issue is touch and go too - minor changes in our code would cause the problem to disappear.
It's hard to say what might cause excessive memory overhead without having a test case or at least a trace of allocations. For "big objects", the allocator uses some heuristics to define for how long to keep memory in internal pools before fully releasing. Might be these heuristics don't work well for your scenario.