Skip to main content
Jump to: navigation, search

Jetty/Howto/Garbage Collection

< Jetty‎ | Howto


Jetty 7 and Jetty 8 are now EOL (End of Life)

All development and stable releases are being performed with Jetty 9.
This wiki is now officially out of date and all content has been moved to the Jetty Documentation Hub

Direct Link to updated documentation:

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.


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:


To disable explicit GC performed regularly by RMI:


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

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

To log GC details to a file:


To print GC activity with less detail:


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

   -XX:+UseConcMarkSweepGC \

Back to the top