Jump to: navigation, search

Difference between revisions of "Jetty/Howto/Garbage Collection"

< Jetty‎ | Howto
(New page: {{Jetty Howto | introduction = GC | examples = (optional) }})
 
m
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Jetty Howto
 
{{Jetty Howto
| introduction = GC
+
| introduction = Tuning the JVM garbage collection (GC) can greatly improve Jetty performance.  Specifically, you can avoid pauses while the system performs full garbage collections. Optimal tuning of the GC depends on the behaviour of the application and requires detailed analysis, however there are general recommendations.
| examples = (optional)
+
| examples = These options are general to the Sun JVM, and work in a JDK 6 installation. They provide good information about how your JVM is running; based on that initial information, you can then tune more finely.
 +
 
 +
To print the implicit flags with which the JVM is configured:
 +
    -XX:+PrintCommandLineFlags
 +
 
 +
To disable explicit GC performed regularly by RMI:
 +
    -XX:+DisableExplicitGC
 +
 
 +
To print the date and time stamps of GC activity with details:
 +
    -XX:+PrintGCDateStamps \
 +
    -XX:+PrintGCTimeStamps \
 +
    -XX:+PrintGCDetails \
 +
    -XX:+PrintTenuringDistribution
 +
 
 +
To log GC details to a file:
 +
    -Xloggc:[path/to/gc.log]
 +
 
 +
To print GC activity with less detail:
 +
    -verbose:gc
 +
 
 +
To use the concurrent marksweep GC with full GC at 80% old generation full:
 +
    -XX:+UseConcMarkSweepGC \
 +
    -XX:CMSInitiatingOccupancyFraction=80
 +
 
 
}}
 
}}

Revision as of 14:10, 25 February 2011



Introduction

Tuning the JVM garbage collection (GC) can greatly improve Jetty performance. Specifically, you can avoid pauses while the system performs full garbage collections. Optimal tuning of the GC depends on the behaviour of the application and requires detailed analysis, however there are general recommendations.




Examples

These options are general to the Sun JVM, and work in a JDK 6 installation. They provide good information about how your JVM is running; based on that initial information, you can then tune more finely.

To print the implicit flags with which the JVM is configured:

   -XX:+PrintCommandLineFlags 

To disable explicit GC performed regularly by RMI:

   -XX:+DisableExplicitGC 

To print the date and time stamps of GC activity with details:

   -XX:+PrintGCDateStamps \
   -XX:+PrintGCTimeStamps \
   -XX:+PrintGCDetails \
   -XX:+PrintTenuringDistribution

To log GC details to a file:

   -Xloggc:[path/to/gc.log] 

To print GC activity with less detail:

   -verbose:gc 

To use the concurrent marksweep GC with full GC at 80% old generation full:

   -XX:+UseConcMarkSweepGC \
   -XX:CMSInitiatingOccupancyFraction=80