3 ms·
All of them. :) A common setup for a generational garbage collector is to have the nursery use a copying collector, which indeed peaks at twice the memory usag
by bjourne 12y ago
All of them. :)
A common setup for a generational garbage collector is to have the nursery use a copying collector, which indeed peaks at twice the memory usage, and then have a tenured generation use a mark and sweep collector. But, roughly, the tenured generation is often 1000 mb or more in size and the nursery only 1 mb. And 1000 + 2*1 isn't that much more than 1000 + 1.
(The above is a huge oversimplification, there are thousands more gc setups that offer different tradeoffs between time and space)