3 ms·
I use the "punch holes" phrase in the following situation: - GC is copying/compacting - GC is at least slightly conservative - allocation is fast/inline/increme
by cracauer 9y ago
I use the "punch holes" phrase in the following situation:
- GC is copying/compacting
- GC is at least slightly conservative
- allocation is fast/inline/increment-only
- that leaves you in a situation where you cannot move/compact some part of the heap
You cannot move the possibly (conservatively) pointed to thing because you cannot adjust the pointer to it (because it might be a non-pointer thing such as an integer.
Now you have some GC unit worth of space occupied by one unmovable object, otherwise it's empty space backed by physical pages. What do you do with the rest of the space? In a C/malloc scheme you are aware of such holes and fill them from new allocations. When you have a fast allocation scheme not involving complex code to find holes you will keep these "hole" as long as the conservative-pointer looking thing exists. You do wipe all the other pointerish things in that GC area, though, so that they don't hold down additional space. Still, now you "waste" a whole GC card worth of physical RAM on a single object, the tradeoff being that you do not want to move to an allocation scheme that spends time thinking about fragmentation.
You could use the empty space in those GC cards as a target for the next moving GC, however that has drawbacks as you know continue to have to special-treat such regular objects co-located with possibly conservatively pointed to objects.
If there is a better term than "punching holes" for this I would be interested.
ETA: now that I think about it, you could give back all physical pages in that GC card that do not contain the held down object. This assumes that GC card size is more than one VM page.