hpcc-systems/HPCC-Platform — pull request #2413 by ghalliday (2012-05-30 09:37:24+00:00)
Title: Fix problem with memory allocator with few allocations

If a fixed size heaplet oscillated between having 0 and 1 entries
allocated within it, a situation could arise where the page was
continually being allocated and freed. This change ensures the
last page is only freed when memory is critical.

Each attempt to allocate a page also checks if there are any pages
that can be freed up in any heaplet. If one of the other heaplets
had large numbers of entries it could take a long time to check if that
heaplet had any pages that could be freed. This should be addressed
separately. However, the two combined caused a spike in cpu usage for
certain graphs.

Fixes #2402

Signed-off-by: Gavin Halliday