Java Reference
In-Depth Information
Table A-2. Flags to choose the GC algorithm
Flag
What it does
When to use it
See also
Uses a simple, single-threaded GC al-
gorithm.
For small (100 MB) heaps. The serial
garbage
collector
-XX:+UseSerialGC
-XX:+UseParallelOldGC Uses multiple threads to collect the old
generation while application threads are
stopped.
When your application can
tolerate occasional long
pauses and you want to
maximize throughput while
minimizing CPU usage.
The
throughput
collector
Uses multiple threads to collect the
young generation while application
threads are stopped.
Use in conjunction with
UseParallelGC.
The
throughput
collector
-XX:+UseParallelGC
Uses background thread(s) to remove
garbage from the old generation with
minimal pauses.
When you have available
CPU for the background
thread, you do not want long
GC pauses, and you have a
relatively small heap.
The CMS
collector
-
XX:+UseConcMarkSweepGC
Uses multiple threads to collect the
young generation while application
threads are stopped.
Use in conjunction with
UseConcMarkSweepGC .
The CMS
collector
-XX:+UseParNewGC
Uses multiple threads to collect the
young generation while application
threads are stopped, and background
thread(s) to remove garbage from the old
generation with minimal pauses.
When you have available
CPU for the background
thread, you do not want long
GC pauses, and you do not
have a small heap.
The G1
collector
-XX:+UseG1GC
Search WWH ::




Custom Search