What do 'real', 'user' and 'sy

2019-03-25 04:38发布

For the following Java version:

OpenJDK version "1.6.0"
OpenJDK Runtime Environment (build 1.6.0-b23)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

With the folllowing GC flags:

-verbose:gc
-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps

We get log lines like:

2012-11-09T16:46:53.438-0100: [CMS-concurrent-mark: 4.039/4.060 secs] [Times: user=4.09 sys=35.05, real=4.06 secs]

The initial "4.039/4.060 secs" should according to https://blogs.oracle.com/poonam/entry/understanding_cms_gc_logs mean that concurrent marking took total 4.039 seconds cpu time and 4.060 seconds wall time (that includes the yield to other threads also).

But what do the user, sys and real values mean here?

1条回答
该账号已被封号
2楼-- · 2019-03-25 05:31
  1. The sys and user are CPU times exclusively. Consequently they do not include the time that the process is blocked for CPU or is doing I/O etc.

  2. The GC time should generally be similar to the sys+user time but if the process is blocked or waiting then it would be higher. This would be true for a serial collector and a single processor box. However, in the multiprocessor environments (with parallel collectors), the GC time would be lesser than the sys+user time since there are multiple CPUs.

  3. The real time would be similar to the GC time.

查看更多
登录 后发表回答