Verified Commit e5b1919f authored by
Rework storage and use of GC statistics
This commit makes two main changes: 1. Various configuration statistics that were duplicated in the GenerationConfig type have been removed, in favour of using the source values from the Config type directly. 2. Updating garbage collection statistics has been reworked, to prevent garbage collection from running too frequently. The first change results in processes requiring less memory, though we are talking about only a handful of bytes. The second change is more interesting. Prior to this commit, the number of allocated blocks was reset to the number of live blocks. If this number would be great enough, the next garbage collection cycle could be scheduled much sooner than necessary. To illustrate this, let's say our threshold is 10 Immix blocks. For the first garbage collection to occur, we thus need to allocate 10 Immix blocks. If 5 Immix blocks remain live after a cycle, we would only need to allocate 5 Immix blocks to trigger the next cycle; instead of allocating 10 Immix blocks. This commit fixes this by resetting the number of allocated blocks after every cycle.
Showing with 118 additions and 132 deletions