Java 7 has been out for a while now, but I cannot find any good resources on the configuration of the garbage collectors, specifically the new G1 collector.
My questions:
- Is G1 the default collector in Java 7 and if not how do I activate G1?
- What optional settings does g1 have in Java7?
- Were there any changes made to other collectors like cms or the parallel collector in Java 7?
- Where can I find good documentation on garbage collection in Java 7?
No G1 is not default garbage collector in jdk 1.7.0_02. The default garbage collector depends upon the class of machine. If the machine is of Server class then the default garbage collector is Throughput Collector. If the machine is of Client class then the default garbage collector is Serial Collector.
By default you don't really want to use G1 collector, as it is not really better than the others. It is only good for special purposes.
In low latency application is is sligthly better than CMS, as it has a little bit shorter, and more predictable pause times. In exchange the throughput is much worse than CMS in exchange.
So it is only good if the latency is important, but the throughput is not important at all. If both are important, then stay with CMS.