My java application (high-volume, low-latency on-line transaction betting system) needs to accomplish the least GC pause while to keep acceptable throughput. When I read java 7 G1GC and thought this is what I really want (I also investigated Azul Zing but stop somewhere in the middle of my study).
I got a strange result when I ran a test with java 7 update 5 and compared it with java 7.0 of same test though.
The java commands associating to GC in my test is not complicate. I only specified several of them and let GC to determine the rest for best performance. The GC options are:
java -Xms12288m -Xmx12288m -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -XX:+PrintCommandLineFlags -XX:+UseG1GC -XX:MaxGCPauseMillis=100 \
This test result meets G1GC specified (more GC times but smaller GC pause). While comparing to the test result of java 7 update 5, the result is quite surprised me:
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)
[INFO] total GC times:8
[INFO] C:/Users/Chris/Documents/My Projects/citibet-2nd/support/matchspace/GC performance/XX_UseG1GC_MaxGCPauseMillis100_java7u5.txt average GC:0.730325 second
[INFO] app stops:18, average seconds:0.325045
[DEBUG] [0.433048, 0.712155, 0.725535, 0.73903, 0.765341, 0.774686, 0.833398, 0.859405]
[INFO] Minimum=11504, Maximum=175425, Total=5220946, Count=40, Average=130523. (total elapsed nano:43241336678)
[INFO] memory in usages after test 101 ends:5626027848, total memory:12884901888, max memory:12884901888 with total 5280000 bets
The throughput does increase but the GC pause-time does not meet the minimum requirement (< 100 millisecond) quite a big difference!
Again, both runnings use same command GC options. System shows to me like:
-XX:InitialHeapSize=12884901888 -XX:MaxGCPauseMillis=100 -XX:MaxHeapSize=12884901888 -XX:+PrintCommandLineFlags -XX:+PrintGC -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDetails -XX:+UseCompressedOops -XX:+UseG1GC
Do I miss something secrets when using java 7 update 5 for GC specific issues?