Subj : Re: Heap contention/BC5.02 crt To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Thu Nov 18 2004 10:38 am Björn Lantz wrote: >I have identified a performance issue for my application that spawns of lot >of threads that make tons of malloc/free. >My question is if there is a free alternative, or maybe some addition to the >BC5.02 runtime libs that has a SMP-optimized heap manager or maybe a way to >set local heaps per thread within a process? Do you really need to malloc the space? Could you instead use local variables? For instance, if you need a variable sized array, but know that the size will never be larger than N, then you could just have a local array of the maximum size , and use a sub-portion of it. Each thread gets it's own stack. You can set the stack size to whatever you need (within reason, say 1-2 MB) (At least, in Win32, not sure about Win16) .