Profiling shows 0 time spent in GC

Questions about YourKit Java Profiler
Post Reply
omera
Posts: 5
Joined: Wed Dec 02, 2020 4:06 pm

Profiling shows 0 time spent in GC

Post by omera »

The profiling results shows zero time spent in GC in the CPU tab, but Memory tab shows frequent GC pauses. What could it be?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Profiling shows 0 time spent in GC

Post by Anton Katilin »

The GC time is reported by the JVM, the profiler shows it as reported.

What JVM and garbage collector do you use?
What is the platform?
omera
Posts: 5
Joined: Wed Dec 02, 2020 4:06 pm

Re: Profiling shows 0 time spent in GC

Post by omera »

OpenJDK 64-Bit Server VM; 1.8.0_111-internal; 25.111-b14; mixed mode
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Profiling shows 0 time spent in GC

Post by Anton Katilin »

You provided no information about the platform (OS) and the GC options used.

Anyway, you're using very old ("1.8.0_111") and likely customized or non-release ("internal") build.

I suggest to try the newest JVM build for your platform from one of prominent OpenJDK vendors.
omera
Posts: 5
Joined: Wed Dec 02, 2020 4:06 pm

Re: Profiling shows 0 time spent in GC

Post by omera »

These are the flags passed to the jvm:

-javaagent:/var/lib/aspectjweaver.jar
-agentpath:/app/libyjpagent.so
-server
-XX:+UseConcMarkSweepGC
-XX:+UseCondCardMark
-XX:-UseBiasedLocking
-Xms1024m
-Xss1m
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Profiling shows 0 time spent in GC

Post by Anton Katilin »

Perhaps JVM does not fully accounts GC activities happening in background GC threads. As I suggested, please try a newer JVM to compare.

Anyway, the profiler cannot do anything to improve accuracy of reported GC CPU times which are supplied by the JVM.

Despite the CPU usage numbers, if there are many GC pauses, there must be significant GC activity. The profiler can help locating the code causing excessive allocations: https://www.yourkit.com/docs/java/help/excessive_gc.jsp
Post Reply