JVM GC Performance Tuning

Here is something about the java gc tuning tips;

1. The heap size consists of three parts: young generation area, old generation area, perm area. In Java, long lived objects such as classes or methods are living in the perm are. There is no way to gc area. So we need to mark the young area clean enough and the perm area big enough. Young generation is separated into three parts: when a new object is “dead”, it will copy from the “from survivor” spaces to the “to survivor” spaces. And the “Eden” area is a place for java to get the objects. So if the “Eden” area is full when a “mini collection” is called, we also name that as “GC”. And when an old generation area is full, we get a “Full collection”. Well, the “Full GC” will consume much time then the “GC” which may make the app a relatively long pause. If “Full GC” is too frequently, the app will pause too long.
2. In java options “-XX: new radio” is set for the radio between for the “young generation” and “old young generation”. E.g. if set to “2”, that may the “young area” will cost one third of the heap space.
3. Another reference index is called “throughput”, which means the time jvm consume for not on the “GC”. So the larger it shows, the better performance will get.
4. “GCViewer” is a open source tool for check the gc log.

你可能感兴趣的:(java,jvm,performance)