0

I have specified following verbose options but JVM is not printing any GC details to the log

-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode 
-verbose:gc  -XX:+PrintGCTimeStamps -XX:+PrintGCDetails 

I am using java 1.8.0_05-b13

I tried some permutation and combination and noticed that only specifying

-verbose:gc  works and logs GC to stdout but following doesn't work

-verbose:gc  -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:GC.log
Krzysztof Krasoń
  • 26,515
  • 16
  • 89
  • 115
Amrish Pandey
  • 800
  • 1
  • 7
  • 11

3 Answers3

0

The -verbose:gc switch makes the application print the GC details to stdout, so make sure that you try to read it from there. You can also use -Xloggc:gcdetails.log to print the details to an actual file instead.

Mike Laren
  • 8,028
  • 17
  • 51
  • 70
0

Just guessing, but jconsole seems to hook into the JVM using JMX beans, while -verbose:gc simply prints directly to stdout from its C++ code and provides no access to it to Java.

Start it locally and look at the standard output to confirm or deny it.

maaartinus
  • 44,714
  • 32
  • 161
  • 320
0

GC parameters were passed as Single string to ProcessBuilder. Sending each JVM argument as separate string to ProcessBuilder fixed it.

Amrish Pandey
  • 800
  • 1
  • 7
  • 11