Monday, May 20, 2013

Concurrent Mark Sweep - Garbage Collection Algorithm - GC Logs Analysis




In Concurrent Mark Sweep GC Algorithm, below pattern of logs can be logged.

2013-03-22T10:00:36.855-0700: 62143.268: [GC 62143.269: [ParNew: 819200K->51200K(870400K), 0.1759446 secs] 1211437K->453032K(2884608K), 0.1762111 secs] [Times: user=0.77 sys=0.00, real=0.18 secs] 

  • New/Young Generation Memory usage is reduced from 819 MB to 51 MB in 0.17 secs. 
  • Max Heap Size Memory usage is reduced from 1211 MB to 453 MB in 0.17 secs. 
  • During this, there won't be any stop the world action. It means user transaction will not be uninterrupted.

2013-03-22T10:24:59.685-0700: 63606.225: [GC [1 CMS-initial-mark: 1871791K(2014208K)] 1907629K(2884608K), 0.0452372 secs] [Times: user=0.04 sys=0.00, real=0.05 secs] 
  • This is stop world action. 
  • In this time, gc is marking the objects in old generation space. 
  • Here, log shows that 1.8 GB is occupied in 2.0 GB old generation , 1.9 gb occupied in 2.8 gb heap space.
  • This initial mark took 0.05 secs.
2013-03-22T10:24:59.730-0700: 63606.270: [CMS-concurrent-mark-start]
  • This is not stop world action.  
  • In this time, GC is started to mark the objects in old generation space.
2013-03-22T10:25:02.885-0700: 63609.426: [CMS-concurrent-mark: 3.044/3.155 secs] [Times: user=14.15 sys=0.36, real=3.16 secs]
  • This is not stop world action.
  • In this action, GC concurrent marking is getting completed.  
  • From the logs, it took 3.16 secs to complete. 
2013-03-22T10:25:02.885-0700: 63609.426: [CMS-concurrent-preclean-start]
  • This is not stop work action.
2013-03-22T10:25:02.913-0700: 63609.453: [CMS-concurrent-preclean: 0.026/0.027 secs] [Times: user=0.05 sys=0.00, real=0.03 secs] 
  • This is not stop world action.
  • From the logs, Pre Clean activity completed in 0.03 secs.


No comments: