Note | ||
---|---|---|
| ||
Modern MyUW uses G1 gc with little "tuning",
G1 gc. It's a wonderful thing. |
Reasoning
In preparation for the Fall 2006 semester UW Madison was looking at ways to improve portal performance. The initial effort was focused at tuning the JVM heap for the way uPortal uses memory.
...
- Java Tuning White Paper
- A general overview of tuning strategies for the JVM.
- Tuning Garbage Collection with Java 5
- Details about the GC options for Java 5.
- Understanding Concurrent Mark Sweep Garbage Collector Logs
- Provides good explanations of all that info the GC logs. The tool https://github.com/chewiebug/GCViewer provides a great visual representation and summary of the data from the GC log file.
- The PrintCompilationFlag
- Not covered here but usefull to learn what the JIT is doing on your system (or if you have HotSpot core dumps)
Testing
We used a jMeter load test script to test each change made to the JVM configuration. The test consisted of the script logging into the portal, visiting one other tab (chosen at random) and logging out. Each test latest 2 hours and was capped at a throughput of 2 requests per second. The throughput cap only applied to the initial view of the home tab after login and the random tab visit.
...
# Turn on GC logging. The GC logs are very useful for tuning your heap. When adjusting the MaxTenuringThreshold PrintTenuringDistribution should be enabled.
-verbose:gc
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails
-XX:+PrintTenuringDistribution
-Xloggc:/my/portal/logs/portal/gc.log
# Enable remote debugging port
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
PrintTenuringDistribution
...
Example gc log output with PrintTenuringDistribution enabled:
No Format |
---|
1096.789: [GC 1096.789: [ParNew
Desired survivor size 86232268 bytes, new threshold 6 (max 12)
- age 1: 50754696 bytes, 50754696 total
- age 2: 12147696 bytes, 62902392 total
- age 3: 12295552 bytes, 75197944 total
- age 4: 6537136 bytes, 81735080 total
- age 5: 2435944 bytes, 84171024 total
- age 6: 3013488 bytes, 87184512 total
- age 7: 627368 bytes, 87811880 total
- age 8: 999536 bytes, 88811416 total
- age 9: 924656 bytes, 89736072 total
- age 10: 1811480 bytes, 91547552 total
: 554848K->89528K(561792K), 0.5317388 secs] 607743K->146164K(1217152K) icms_dc=18 , 0.5326526 secs]
|
...