phantomuserland
phantomuserland copied to clipboard
In mem snapshot based GC
Do not free snapshot memory image, map it in a separate address space, run full GC there.
See #129
Possibly should scan through kernel DS address space to check for links from kernel to obj mem? Scan allocated physmem and vaddr pages too?
hal_page_control( add_space_id (pool id?), ... )
- addr_space_obj_off
- addr_space_obj_on
- addr_space_obj_gc - prev generation of objects for GC
- ADDR_SPACE_ALL - change in all maps, but only out of obj space
Use snap verification infrastructure for it Need some kind of cache - use pool for pages and hash tab for map of addr to pool item
It is unclear how to prevent situation:
-
obj a used
-
snap
-
big GC runs on snap and finds a to be free
-
obj a freed by refcount
-
new obj created @ addr of a
-
big GC finishes and kills a
-
generations? per snap?
TODO: Need refcnt GC to be run before snapshot - just a good occasion and, possibly, less mem to pageout.
NB! need some way to request disk io barrier from here
Keep state in persistent memory! Map address to object info