我在第八个核心和 264G 内存 linux 机器中使用 hazelcast。接下来是我的启动脚本。
nohup java -Djava.rmi.server.hostname=172.19.141.2 -server -Xms40G -Xmx40G -XX:+PrintGCDateStamps -XX:+PrintGCDetails -Xloggc:./logs/gc.log -Xss256k -XX:PermSize=128M -XX:MaxPermSize=512M -Djava.util.Arrays.useLegacyMergeSort=true -XX:+UseG1GC -XX:G1HeapRegionSize=32 -XX:MaxGCPauseMillis=600 -XX:InitiatingHeapOccupancyPercent=70 -XX:+HeapDumpOnOutOfMemoryError -Dhazelcast.jmx=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=2222 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.net.preferIPv4Stack=true -Djava.ext.dirs=../lib:../lib-business:../lib-other com.hazelcast.core.server.StartServer &
我的问题是完整的 gc 大约需要 12 秒,这是不可接受的。我尝试设置-XX:MaxGCPauseMillis=600参数。但它没有用。这是 gc 日志。
2017-04-28T21:38:17.795+0800: 9237.910: [Full GC (Allocation Failure) 27G->7361M(40G), 15.6893722 secs]
[Eden: 1024.0K(2010.0M)->0.0B(2048.0M) Survivors: 38.0M->0.0B Heap: 27.5G(40.0G)->7361.6M(40.0G)], [Metaspace: 17817K->17726K(18432K)]
[Times: user=23.49 sys=0.16, real=15.69 secs]
希望得到您的帮助。
经过一些测试,我发现是大对象导致gc很多时间。当我删除大对象时,年轻的gc不到500ms并且没有完整的gc这么长时间。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句