Opened 7 years ago

Closed 5 years ago

#1379 closed enhancement (fixed)

Improve "heap-shrinkage" rate

Reported by: felix winkelmann Owned by:
Priority: minor Milestone: 5.2
Component: core libraries Version: 4.12.0
Keywords: gc heap Cc:
Estimated difficulty: trivial


Submitted by Sven Hartrumpf to chicken-hackers:

I would like to experiment with heap shrinking (-:hs) for long
running, memory/GC intensive processes.

I checked runtime.c and I read the following shrink condition:

count < percentage(percentage(heap_size, C_heap_shrinkage),


This would imply that heap usage must be < 12.5 % to lead to a heap
shrink because C_heap_shrinkage (via DEFAULT_HEAP_SHRINKAGE) is 50 %
This (< 12.5 %) is very unlikely for many applications :-)
How about:

count < percentage(heap_size, DEFAULT_HEAP_SHRINKAGE_USED) ?

Change History (3)

comment:1 Changed 5 years ago by felix winkelmann

Milestone: someday5.2
Type: defectenhancement

comment:2 Changed 5 years ago by sjamaan

After messing around with this code a bit, but the confusing part is that "count" refers to the used amount of bytes, but as far as I can tell, heap_size is the full heap size (both halves).

comment:3 Changed 5 years ago by sjamaan

Resolution: fixed
Status: newclosed

Fixed with 160fb5198a9cf24c2bee79a0058034824a275abf

Note: See TracTickets for help on using tickets.