Even if there is enough JAVA memory – why repeat Java garbage collection

Our java process consumes a lot of CPU, and the log shows that it often performs GC, even if the memory used is about 5GB (from the JMX console), while the memory of min and Max is 10GB

Our JVM args is: JVM_ GC =“ – verbose:gc -Xnoclassgc -XX:PrintGCDetails -XX:UseParNewGC -XX:NewSize = 3GB -XX:ParallelGCThreads = 8 -XX:MaxTenuringThreshold = 15 -XX:UseConcMarkSweepGC”

And minheap = maxheap = 10GB

What might trigger GC? Why does it happen so often and so fast? In addition to obtaining some settings through JMX, we cannot connect any type of analysis tool to its production box... Thank you GC log

@2011-07-20 02:10:46 [Full GC (system) [CMS: 3333423k - > 4019122k (7340032k), 13.4979250 secs] 4876606k - > 4019122k (10171200k), [CMS perm: 21656k - > 21608k (21824k)], 13.4980930 seconds S] [time: user = 12.99 sys = 0.50, real = 13.50 seconds] [GC [1 CMS initial mark: 4019122k (7340032k)] 4041525k (10171200k), 0.0009110 secs] [times: user = 0.00, Sys = 0.00, real = 0.00 secs] @ 2011-07-20 02:11:10 [CMS concurrency flag: 10.322 / 10.753 seconds] [time: user = 21.55, Sys = 0.22, actual = 10.75 seconds] [CMS concurrent preclean: 0.035 / 0.036 secs] [times: user = 0.04, Sys = 0.00, real = 0.04 secs] @ 2011-07-20 02:11:15 CMS: pre sweep aborted due to time [CMS concurrent abortable preclean: 1.083/5.063 secs] [times: user = 1.08, Sys = 0.00, real = 5.06 secs] [GC [YG occupancy: 282204 K (2831168 K)] [rescan (parallel), 0.0402030 seconds] [weak reference processing, 0.0010550 seconds] [1 CMS - Remarks: 4019122k (7340032k)] 4301 326k (10171200k), 0.0413630 seconds] [times: user = 0.07, Sys = 0.01, real = 0.04 secs] @ 2011-07-20 02:11:16 [CMS concurrent sweep: 2.627 / 2.627 secs] [time: user = 2.63, Sys = 0.00, real = 2.63 seconds] [CMS concurrent reset: 0.039 / 0.039 secs] [times: user = 0.04, Sys = 0.00, real = 0.04 secs] @ 2011-07-20 02:11:20 [GC [1 CMS initial mark: 4019034k (7340032k)] 4301238k (10171200K), 0.0308450 secs] [times: user = 0.03, Sys = 0.00, real = 0.03 secs] @ 2011-07-20 02:11:30 [CMS concurrent mark: 10.304 / 10.307 secs] [time: user = 20.48, Sys = 0.11, real = 10.31 seconds] [CMS concurrent preclean: 0.018 / 0.019 secs] [times: user = 0.02, Sys = 0.00, real = 0.01 secs] @ 2011-07-20 02:11:35 CMS: abort preclean due to time [CMS concurrent abortion pre cleaning: 1.043 / 5.048 seconds] time: user = 1.03 sys = 0.00, actual = 5.05 seconds] [GC [YG occupancy: 282204 K (2831168 K)] [rescan (parallel), 0.0419560 seconds] [weak reference processing, 0.0010880 seconds] [1 CMS remarks: 4019034k (7340032k)] 4301 238k (10171200k), 0.0431480 seconds] [time: user = 0.07 sys = 0.01, actual = 0.05 seconds] @ 2011-07-20 02:11:38 [CMS concurrent sweep: 2.622 / 2.622 secs] [time: user = 2.63 sys = 0.00, real = 2.62 seconds] [CMS concurrent reset: 0.039 / 0.039 secs] [times: user = 0.04 sys = 0.00, real = 0.04 secs]

Solution

Try using usecmsinitiatingoccupancyonly & cmsinitiatingoccupancyfraction flag Using these flags to start the CMS set will be triggered according to the occupancy rate In addition, it may have the significance of increasing the scale of lifelong generation

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>