4 ms·
Isn't memory only shuffled around during compaction? Why not mark/sweep in parallel, then stop-the-world at compaction time?
by m0th87 13y ago
Isn't memory only shuffled around during compaction? Why not mark/sweep in parallel, then stop-the-world at compaction time?
- Skinney 13y agoIn a nutshell, generational GCs works by scanning live data. Thus, anything not scanned is garbage. While the application is running, it also allocates new data. If you allocate an object somewhere --after-- that area has been scanned, the GC will treat that area as garbage, and then you will have memory corruption, leading to segfaults and other nice things. While parallel mark/sweep is certainly doable (Java does this) it's not easy to get right.