Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding Java's GC logs

I turned on verbose GC options on my JDK, and now I'm seeing lines such as

25.598: [CMS-concurrent-sweep-start]
25.622: [CMS-concurrent-sweep: 0.023/0.024 secs] [Times: user=0.02 sys=0.00, real=0.03 secs]
25.623: [CMS-concurrent-reset-start]
25.629: [CMS-concurrent-reset: 0.007/0.007 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]

Anyone care to tell me exactly what all the parameters there mean?

  1. What's the difference between sys+user and real times?
  2. What does "0.023/0.024 secs" mean?
like image 435
ripper234 Avatar asked Jan 29 '26 02:01

ripper234


2 Answers

I think it's just related to CPU usage..

  1. real is the absolute difference of time between end and start (not excluding context switches)
  2. user is how much time is spent while executing code in user space
  3. sys is how much time is spent while execting system code (eg. system calls or everything else that moves control from user code to kernel code)

A note: while real doesn't represent effective time (because of including also time in which GC goes away from CPU to let it to something else) sys+user does.

EDIT

CMS-concurrent-sweep is the phase in which GC actually cleans useless objects (it's done after the marking phase). In this case it's concurrent because GC works together with application without pausing it and time should be time used (maybe time-start / time-end, not sure about that)

like image 72
Jack Avatar answered Jan 31 '26 17:01

Jack


As per http://www.sun.com/bigadmin/content/submitted/cms_gc_logs.html , the two numbers 0.023/0.024 are CPU/wall times.

like image 44
Jé Queue Avatar answered Jan 31 '26 16:01

Jé Queue



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!