Summary
Improve "heap-shrinkage" rate
Metadata
- Id: c0de9ea92e57875a71097cdc8ea997ee8c991e25
- Trac id: 1379
- Type: enhancement
- Reporter: felix
- Owner:
- Cc:
- Status: closed
- Component: core libraries
- Estimated difficulty: trivial
- Resolution: fixed
- Priority: minor
- Milestone: 5.2
- Version: 4.12.0
- Changetime: 2019-12-12 16:13:37 UTC
- Created: 2017-06-16 18:00:15 UTC
- Keywords: gc heap
Description
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),
DEFAULT_HEAP_SHRINKAGE_USED)
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 % and DEFAULT_HEAP_SHRINKAGE_USED is 25 %. This (< 12.5 %) is very unlikely for many applications :-) How about:
count < percentage(heap_size, DEFAULT_HEAP_SHRINKAGE_USED) ?
Changes and comments
[2019-06-12 17:18:24 UTC] felix changed type from defect to enhancement
[2019-06-12 17:18:24 UTC] felix changed milestone from someday to 5.2
[2019-12-01 12:29:06 UTC] sjamaan wrote:
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).
[2019-12-12 16:13:37 UTC] sjamaan changed status from new to closed
[2019-12-12 16:13:37 UTC] sjamaan set resolution to fixed
[2019-12-12 16:13:37 UTC] sjamaan wrote:
Fixed with 160fb5198a9cf24c2bee79a0058034824a275abf