From: Leandro Lucarella Date: Thu, 16 Sep 2010 03:35:35 +0000 (-0300) Subject: Accommodate the heap size to the working set size X-Git-Url: https://git.llucax.com/software/dgc/cdgc.git/commitdiff_plain/fab64ab48e28ed336fb0cdc638d656aacb89e614?ds=sidebyside;hp=fab64ab48e28ed336fb0cdc638d656aacb89e614 Accommodate the heap size to the working set size The GC can have a lot of pressure if a collection recovers very little memory, but enough to fulfill the current memory request, causing a lot of collections with too little gain (when the key to a efficient GC is recover the bigger amount of memory with as little work as possible). This effect is greatly reduced when using eager allocation, because eventually the GC will allocate more memory, but heap minimization can trigger this effect again. This patch adds an option, min_free, which specifies the minimum percentage of heap that should be free after a collection. If the free heap is less than min_free% of the total heap, the GC will allocate a new pool, big enough to fulfill that requirement. If the free heap is bigger than min_free% of the total heap, the GC will try to release some pools to the OS to keep the heap occupancy near min_free%. ---