欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

求教一个jvm优化的问题

程序员文章站 2022-06-06 22:05:26
...

jvm生成的gc.log日志部分如下:
系统正常运行的时候以下日志:
188934.293: [GC (Allocation Failure) [PSYoungGen: 162811K->22501K(174592K)] 1893545K->1753267K(2066944K), 0.0242581 secs] [Times: user=0.05 sys=0.00, real=0.03 secs]
188934.663: [GC (Allocation Failure) [PSYoungGen: 166373K->20315K(174080K)] 1897139K->1751958K(2066432K), 0.0240071 secs] [Times: user=0.04 sys=0.00, real=0.02 secs]
188935.024: [GC (Allocation Failure) [PSYoungGen: 164187K->19269K(175104K)] 1895830K->1750952K(2067456K), 0.0231600 secs] [Times: user=0.05 sys=0.00, real=0.03 secs]
188935.384: [GC (GCLocker Initiated GC) [PSYoungGen: 164677K->19503K(175104K)] 1896758K->1751624K(2067456K), 0.3015056 secs] [Times: user=0.05 sys=0.00, real=0.30 secs]
188935.985: [GC (Allocation Failure) [PSYoungGen: 164911K->22427K(176128K)] 1897249K->1754788K(2068480K), 0.0237001 secs] [Times: user=0.04 sys=0.00, real=0.03 secs]
188936.317: [GC (Allocation Failure) [PSYoungGen: 169371K->20251K(175616K)] 1901732K->1752644K(2067968K), 0.0238539 secs] [Times: user=0.04 sys=0.00, real=0.03 secs]
188936.623: [GC (Allocation Failure) [PSYoungGen: 167195K->21157K(177152K)] 1899588K->1754567K(2069504K), 0.0252904 secs] [Times: user=0.04 sys=0.00, real=0.03 secs]
系统崩溃时候的日志:
240231.356: [GC (Allocation Failure) [PSYoungGen: 137056K->25792K(151552K)] 2003814K->1909806K(2043904K), 0.0336642 secs] [Times: user=0.06 sys=0.01, real=0.03 secs]
240231.390: [Full GC (Ergonomics) [PSYoungGen: 25792K->0K(151552K)] [ParOldGen: 1884013K->1838445K(1892352K)] 1909806K->1838445K(2043904K), [Metaspace: 69010K->68999K(1114112K)], 2.6492174 secs] [Times: user=4.98 sys=0.03, real=2.65 secs]
240234.376: [GC (Allocation Failure) [PSYoungGen: 97237K->28849K(150528K)] 1935682K->1867294K(2042880K), 0.0311394 secs] [Times: user=0.06 sys=0.00, real=0.03 secs]
240234.724: [GC (Allocation Failure) [PSYoungGen: 126129K->29436K(154624K)] 1964574K->1867881K(2046976K), 0.0341698 secs] [Times: user=0.06 sys=0.00, real=0.04 secs]
240235.071: [GC (Allocation Failure) [PSYoungGen: 132348K->28918K(153088K)] 1970793K->1867363K(2045440K), 0.0328635 secs] [Times: user=0.06 sys=0.00, real=0.04 secs]
240235.592: [GC (Allocation Failure) [PSYoungGen: 131830K->29876K(157696K)] 1970275K->1868321K(2050048K), 0.0314764 secs] [Times: user=0.06 sys=0.00, real=0.03 secs]
240235.867: [GC (Allocation Failure) [PSYoungGen: 138932K->29868K(156160K)] 1977377K->1868313K(2048512K), 0.0304961 secs] [Times: user=0.06 sys=0.01, real=0.03 secs]
240235.991: [GC (Allocation Failure) [PSYoungGen: 138924K->29984K(160768K)] 1977369K->1868429K(2053120K), 0.0267918 secs] [Times: user=0.05 sys=0.00, real=0.03 secs]
240236.392: [GC (Allocation Failure) [PSYoungGen: 145184K->30410K(159232K)] 1983629K->1868855K(2051584K), 0.0324369 secs] [Times: user=0.07 sys=0.00, real=0.03 secs]
240236.768: [GC (Allocation Failure) [PSYoungGen: 145600K->31879K(162816K)] 1984045K->1870324K(2055168K), 0.0321725 secs] [Times: user=0.06 sys=0.00, real=0.03 secs]
240237.154: [GC (GCLocker Initiated GC) [PSYoungGen: 151687K->31508K(161792K)] 1990178K->1870000K(2054144K), 0.0327585 secs] [Times: user=0.07 sys=0.00, real=0.04 secs]
240237.565: [GC (Allocation Failure) [PSYoungGen: 151316K->41468K(155136K)] 1990017K->1884117K(2047488K), 0.0535050 secs] [Times: user=0.10 sys=0.00, real=0.05 secs]
240237.881: [GC (Allocation Failure) [PSYoungGen: 155132K->45568K(159232K)] 1997781K->1920879K(2051584K), 0.0963625 secs] [Times: user=0.19 sys=0.00, real=0.10 secs]
240237.978: [Full GC (Ergonomics) [PSYoungGen: 45568K->0K(159232K)] [ParOldGen: 1875311K->1879211K(1892352K)] 1920879K->1879211K(2051584K), [Metaspace: 68999K->68999K(1114112K)], 2.9301065 secs] [Times: user=5.57 sys=0.03, real=2.93 secs]
240241.284: [Full GC (Ergonomics) [PSYoungGen: 113664K->0K(159232K)] [ParOldGen: 1879211K->1884633K(1892352K)] 1992875K->1884633K(2051584K), [Metaspace: 68999K->68999K(1114112K)], 2.8250989 secs] [Times: user=5.38 sys=0.03, real=2.83 secs]
240244.281: [Full GC (Ergonomics) [PSYoungGen: 113633K->0K(159232K)] [ParOldGen: 1884633K->1885318K(1892352K)] 1998266K->1885318K(2051584K), [Metaspace: 68999K->68999K(1114112K)], 2.6993627 secs] [Times: user=5.13 sys=0.02, real=2.70 secs]
240247.258: [Full GC (Ergonomics) [PSYoungGen: 113664K->0K(159232K)] [ParOldGen: 1885318K->1884853K(1892352K)] 1998982K->1884853K(2051584K), [Metaspace: 68999K->68999K(1114112K)], 3.0225106 secs] [Times: user=5.77 sys=0.03, real=3.02 secs]
240250.707: [Full GC (Ergonomics) [PSYoungGen: 113664K->0K(159232K)] [ParOldGen: 1884853K->1884195K(1892352K)] 1998517K->1884195K(2051584K), [Metaspace: 68999K->68995K(1114112K)], 2.8711543 secs] [Times: user=5.42 sys=0.02, real=2.87 secs]
240254.008: [Full GC (Ergonomics) [PSYoungGen: 113664K->0K(159232K)] [ParOldGen: 1885876K->1884390K(1892352K)] 1999540K->1884390K(2051584K), [Metaspace: 68995K->68995K(1114112K)], 2.7715919 secs] [Times: user=5.26 sys=0.03, real=2.77 secs]
240257.077: [Full GC (Ergonomics) [PSYoungGen: 113606K->0K(159232K)] [ParOldGen: 1887564K->1883865K(1892352K)] 2001170K->1883865K(2051584K), [Metaspace: 68995K->68995K(1114112K)], 2.7348059 secs] [Times: user=5.21 sys=0.01, real=2.74 secs]
240259.842: [Full GC (Ergonomics) [PSYoungGen: 113664K->0K(159232K)] [ParOldGen: 1883865K->1883405K(1892352K)] 1997529K->1883405K(2051584K), [Metaspace: 68995K->68995K(1114112K)], 2.8967241 secs] [Times: user=5.53 sys=0.02, real=2.90 secs]
240263.284: [Full GC (Ergonomics) [PSYoungGen: 113664K->0K(159232K)] [ParOldGen: 1883405K->1885915K(1892352K)] 1997069K->1885915K(2051584K), [Metaspace: 68995K->68995K(1114112K)], 2.9344210 secs] [Times: user=5.59 sys=0.03, real=2.93 secs]
240266.638: [Full GC (Ergonomics) [PSYoungGen: 113590K->0K(159232K)] [ParOldGen: 1885915K->1884195K(1892352K)] 1999506K->1884195K(2051584K), [Metaspace: 68995K->68995K(1114112K)], 2.5923498 secs] [Times: user=4.92 sys=0.03, real=2.60 secs]
240269.616: [Full GC (Ergonomics) [PSYoungGen: 113664K->0K(159232K)] [ParOldGen: 1884837K->1885386K(1892352K)] 1998501K->1885386K(2051584K), [Metaspace: 68995K->68995K(1114112K)], 3.0897188 secs] [Times: user=5.90 sys=0.03, real=3.09 secs]

请教以下这大概是什么原因导致的呢。
jvm版本:
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
服务器配置:2核4G内存

另外请教以下下面两行日志的参数分别指的是什么,以及怎么分析这些日志,度娘上面找了很多资料都看不懂这个。。。
240237.565: [GC (Allocation Failure) [PSYoungGen: 151316K->41468K(155136K)] 1990017K->1884117K(2047488K), 0.0535050 secs] [Times: user=0.10 sys=0.00, real=0.05 secs]
240269.616: [Full GC (Ergonomics) [PSYoungGen: 113664K->0K(159232K)] [ParOldGen: 1884837K->1885386K(1892352K)] 1998501K->1885386K(2051584K), [Metaspace: 68995K->68995K(1114112K)], 3.0897188 secs] [Times: user=5.90 sys=0.03, real=3.09 secs]
问题补充:应用启动参数:
java -server -Xmx2g -Xms2g -Xmn200m -verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -jar spigot-1.7.9-R0.3-SNAPSHOT.jar
jvm优化 jvm gc.log gc日志
2014年12月10日 15:02 stevenkang
20
0 0 3

添加评论关注(5)
2个答案 按时间排序 按投票排序

0
0
fullGC回收old区几乎不变,目测内存泄露了,JVM加个参数HeapDumpOutOfMemoryError 然后用MAT工具分析

2014年12月11日 11:04木木_三
30
0 0 2
添加评论
0
0
输出的格式解释见
http://www.herongyang.com/JVM/Memory-PrintGCDetails-Garbage-Collection-Logging.html

FullGC没办法回收对象,Old区基本满了,现象应该是程序卡死吧。

学习用jvisualVM检查下内存泄露