posted 19 years ago
As a brief summarization of the articles I read from Internet, I know the default GC algorithm of Sun 1.3 JVM is something like below:
1. New objects are created in Eden.
2. During a Minor GC, objects in Eden are moved to one of the two Survivor Spaces (SS).
3. In the successive Minor GCs, objects in one SS will be moved to the other.
4. When an object has survived for a number of Minor GC, it will be moved to the old space.
5. Only a Full GC will check the aliveness of the objects located in old space.
Then, I read that there is an option -Xincgc that can enable an Incremental Collector, which divide the heap into small chunks called trains and cars, and reclaim the memory of one train/car at a time.
My question is, when I enabled the Incremental Collector, how will the default algorithm be affected? Is it
1. the default algorithm is simply ignored. No more eden/SS/old space/perm space. The whole heap space is simply divided into trains and cars, or
2. based on the default algorithm, the Minor GC and Full GC works in an incremental way?