pharo-vm
pharo-vm copied to clipboard
[WIP] Incremental gc
Start thinking in an incremental GC during a VM dojo
Entry point of the GC in the VM is in SpurMemoryManager>>sufficientSpaceAfterGC: We added a call to incrementalFullGC and finishIncrementalFullGCWithoutInterruption Then, we duplicated the GC logic into these two submethods Note: we must change SpurMemoryManager>>fullGC primitive that is called from the image side
So far we only tried to let the VM execute Pharo code in between the different steps of the mark phase. VM compilation is ok but there are VM crashes probably because:
- we should suspend the GC in nicer points (when a given number of objects have been marked for example) instead of what we did
- newly allocated objects are not marked and will be thrown away should we always mark newly allocated objects when the incremental GC is running
- internal data structure used during the mark phase may be lost ...
Unit test to write:
c := OrderedCollection new.
64 timesRepeat: [ c add: (Array new: 1024*1024) pin ].
c := nil.
3 timesRepeat: [ Smalltalk garbageCollect ]