Java G1 GC Processing Reference objects works slow

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 05:59:07

Its important that all my runs were with Yourkit profiler. I installed fastdebug build of OpenJDK7. At this version there is a parameter -XX:+TraceReferenceGC. After running with this parameter gc log shown about 5000 some finalizers. This problem was resolved by turning off socket probes of Yourkit.

As a first step you can use VisualVM or any tool to analyze your heap usage pattern. You might have a solution by optimising your code, by checking hotspots of object creation and that should be a permanant solution.

If that is not possible you have to find the optimal heap size and a GC algorithm suiting your applications behaviour. This is going to be a trial and error method. You will definitly have to go through tuning doc. The tuning you do now might again become inefficient later when your application behaviour changes or load pattern changes.

Try and find the suitable collector for you. You will be tweaking some parameters like

    -XX:+UseConcMarkSweepGC        
    -XX:SurvivorRatio=10 
    -XX:TargetSurvivorRatio=90 
    -XX:MaxTenuringThreshold=30

by trial and error.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!