3 ms·
Copying garbage collectors benefit from virtual memory. Copying GC needs two same sized memory pools. One is used and one is empty. If you have same amount of
by hannibal5 13y ago
Copying garbage collectors benefit from virtual memory.
Copying GC needs two same sized memory pools. One is used and one is empty. If you have same amount of virtual memory as ram, the empty unused one can reside in the virtual memory. When GC happens live data is copied (and compacted) from live pool to empty pool and the roles switched. With virtual memory, you can use as much ram as there is without affecting performance significantly.
If you do manual memory management, long running programs cause memory fragmentation. If allocated memory sizes are very variable in size, available memory can be half of the actual memory in the long run.
In theory, moving and compacting GC with virtual memory can almost double the available ram compared to manual memory management.