Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Garbage collection

Hey Sam,

you can use jconsole to identify which GC algorithm is used by your VM.

The tool is located in

If you will, perform the following steps
1. Start your Jetty, maybe find out the Process ID (PID).
2. Start jconsole.
3. Connect jconsole to your running Jetty process (identified by PID).
4. Confirm any insecure connection. I think it is pretty safe if you connect to your local Jetty process. 5. You will find the selected GC algorithm in the *VM Summary* tab in the third section that also deals with memory statistics.

Example output (from jconsole VM itself):

Current heap size: 22.771 kbytes
Maximum heap size: 7.433.216 kbytes
Committed memory: 45.056 kbytes
Pending finalization: {0} objects
Garbage collector: Name = 'PS MarkSweep', Collections = 2, Total time spent = 0,081 seconds Garbage collector: Name = 'PS Scavenge', Collections = 44, Total time spent = 0,111 seconds

You may refer to Angelika Langer for more information on the whole topic: Besides, there is a bunch of sites available regarding Garbage Collection.

Once you decided to choose a certain GC, you can configure it within start.ini, where you find the exhausting section:

# Configure JVM arguments.
# If JVM args are include in an ini file then --exec is needed
# to start a new JVM from start.jar with the extra args.
# If you wish to avoid an extra JVM running, place JVM args
# on the normal command line and do not use --exec
# --exec
# -Xmx2000m
# -Xmn512m
# -XX:+UseConcMarkSweepGC
# -XX:ParallelCMSThreads=2
# -XX:+CMSClassUnloadingEnabled
# -XX:+UseCMSCompactAtFullCollection
# -XX:CMSInitiatingOccupancyFraction=80
# -verbose:gc
# -XX:+PrintGCDateStamps
# -XX:+PrintGCTimeStamps
# -XX:+PrintGCDetails
# -XX:+PrintTenuringDistribution
# -XX:+PrintCommandLineFlags
# -XX:+DisableExplicitGC

Hope this helps you.


------ Originalnachricht ------
Von: "Sam Giraffe" <sam@xxxxxxxxxxxxxxx>
An: "JETTY user mailing list" <jetty-users@xxxxxxxxxxx>
Gesendet: 25.11.2013 19:12:22
Betreff: Re: [jetty-users] Garbage collection
How would I check if the environment I inherited is using a GC
algorithm in Jetty?
I searched for 'parallel', and also for 'garbage' in Jetty's etc
directory and did not come up with anything.
I am assuming if it was specified it would be in Jetty.XML or perhaps start.ini?


On Mon, Nov 25, 2013 at 9:39 AM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
Jetty (the default distribution) is not configured for any specific GC
The JVM you use to start Jetty can be configured to use whatever technique
 you want to.

 Since we run on a huge variety of hardware (from super small embedded
systems, to mobile handsets, to desktops, to commodity server hardware, and even up to massively parallel compute engines) we don't tend to specify JVM
 specific configurations in our default distribution.

 Joakim Erdfelt <joakim@xxxxxxxxxxx> -
Expert advice, services and support from from the Jetty & CometD experts -

On Mon, Nov 25, 2013 at 10:33 AM, Sam Giraffe <sam@xxxxxxxxxxxxxxx> wrote:


 Which garbage collection algorithm does Jetty use by default?
 As I understand Java has the following:

 - Serial
 - Parallel +UseParallelGC
 - Concurrent

JVM uses serial by default, AFAIK, and since my system is multi-core I
 would assume that I should change JVM to use Parallel GC with Jetty?

 Thank you
 jetty-users mailing list

 jetty-users mailing list

jetty-users mailing list

Back to the top