Java Reference
In-Depth Information
G1 is a concurrent collector: the old generation is processed by background threads that
don't need to stop the application threads to perform most of their work. Because the old
generation is divided into regions, G1 can clean up objects from the old generation by copy-
ing from one region into another, which means that it (at least partially) compacts the heap
during normal processing. Hence, a G1 heap is much less likely to be subject to fragmenta-
tion—though that is still possible.
Like CMS, the trade-off for avoiding the full GC cycles is CPU time: the multiple back-
ground threads must have CPU cycles available at the same time the application threads are
running. G1 is enabled by specifying the flag -XX:+UseG1GC (which by default is false ).
Search WWH ::

Custom Search