Jetty Logo
Version: 9.3.1-SNAPSHOT
Contact the core Jetty developers at

private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery

Chapter 19. Optimizing Jetty

Table of Contents

Garbage Collection
High Load
Limiting Load

There are many ways to optimize Jetty, which vary depending on the situation. Are you trying to optimize for number of requests within a given amount of time? Are you trying to optimize the serving of static content? Do you have a large bit of hardware that you want to give entirely over to Jetty to use to its heart's delight? Here are a few of the many different ways to optimize Jetty.

Garbage Collection

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.

Tuning 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:



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 \


See an error or something missing? Contribute to this documentation at Github!(Generated: 2015-12-01T01:01:38+00:00)