Questions regarding GC

Thomas Schatzl thomas.schatzl at oracle.com
Tue Feb 23 12:48:31 UTC 2016


Hi Jun,

On Sat, 2016-02-20 at 04:15 +0000, Jun Zhuang wrote:
> Hi,
>  
> I tried to find answers to a couple of questions I have regarding GC
> but found nothing on the Internet, I wonder if the experts here can
> help me out?
>  
> ·         How are objects stored in the old generation when promoted
> from the young gen or survivor space? Does the JVM use something
> similar to the TLAB?

  as Tao already mentioned, the equivalent is PLAB (Promotion Local
Allocation Buffer). All collectors but Serial GC (which, due to being
single threaded) use them.

Parallel GC always uses PLABs of the same size, CMS and G1 support
dynamic PLAB resizing. You could play around with that using the -XX:+/
-ResizePLAB and -XX:Old/YoungPLABSize options. However, generally, the
collector's automatic PLAB sizing is pretty good.

> ·         The time for a young GC pause consists stack scan, card
> scan and copying, are there command line options for me to get a time
> breakdown for those times in the GC log?

Only G1 provides a detailed breakdown of the phases, most detail with 
-XX:+EnableExperimentalVMOptions -XX:G1LogLevel=finest (on 8u60). Tao
already mentioned a few of the more useful options.

Beginning with JDK9, due to changes with the logging system, something
like -Xlog:gc*=trace will get you all available information (iirc).

There are some aliases (-XX:+PrintGCDetails -XX:+PrintGC) that map to
the new logging options, but some of the logging switches are/will not
be usable any more.

Thanks,
  Thomas



More information about the hotspot-gc-use mailing list