Full GC Single Thread?

charlie hunt charlie.hunt at oracle.com
Fri Apr 25 11:41:17 UTC 2014


If you are not specifying a GC as a command line option on JDK 6u22, and your system is identified by HotSpot as a server class machine [1], HotSpot will automatically use ParallelGC as the default GC.  Full GCs in ParallelGC, (the portion that collects old generation) is single threaded.  If you explicitly set -XX:+UseParallelOldGC, Full GCs will be multi-threaded, (both the old generation part and the young generation part).

Fwiw, if you also enable -XX:+PrintGCDetails you can look at the “CPU” info, i.e. user, sys, real values and get a sense of the parallelism realized on a given GC.  In simplistic terms, the higher the difference in usr times versus real time, the greater the parallelism.

hths,

charlie

PS:  Stating the obvious, Java 6, is a rather old technology, (iirc circa 2006 or 2007).  You’ll likely get better GC and app performance by moving to a more recent Java 7 update release or Java 8.

[1]: Server class machine is a system that has 2 or more GB of RAM and two or more virtual processors (not CPU sockets, hardware threads as in like the value returned by Runtime.availableProcessors()).

On Apr 25, 2014, at 3:23 AM, Denny Kettwig <Denny.Kettwig at werum.com> wrote:

> Hey folks,
>  
> simple question I cannot find an answer to.
>  
> Is a Full GC a single thread operation per default and if that is the case will it become multi-threaded by using -XX:+UseParallelOldGC ?
>  
> We are on JDK 1.6 u22.
>  
> Kind Regards
>  
> Denny
>  
> _______________________________________________
> hotspot-gc-use mailing list
> hotspot-gc-use at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20140425/362697f4/attachment-0001.html>


More information about the hotspot-gc-use mailing list