java - 为什么 ParNew GC 时间随着老年代的大小而增加?
问题描述
我发现了一个奇怪的事情,ParNew GC 时间随着老年代大小的增加而增加,而在 Old GC(CMS) 之后,它又恢复了正常。老年代大小影响年轻gc时间吗?
这是我的 jvm 选项:
-server -Xmx6656M -Xms6656M -Xmn4436M -XX:SurvivorRatio=8 -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m
-XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=4 -XX:ConcGCThreads=3 -XX:MaxTenuringThreshold=7 -XX:+CMSParallelInitialMarkEnabled -XX:+ParallelRefProcEnabled -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly
-Xloggc:/dev/shm/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=2 -XX:GCLogFileSize=50M
-XX:-UseCounterDecay -XX:AutoBoxCacheMax=20000 -XX:+AlwaysPreTouch -XX:MaxJavaStackTraceDepth=10000 -XX:-OmitStackTraceInFastThrow -XX:+UseCountedLoopSafepoints -XX:-UseBiasedLocking -XX:+ExplicitGCInvokesConcurrent -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses
我怀疑这是因为年轻的 gc 工作时内存紧凑。
我怎样才能解决这个问题?
解决方案
Young GC with CMS collector involves dirty card scanning to capture old-to-young references. Size of dirty card table is proportional to size of old space.
More details are available in this article.
推荐阅读
- javascript - Amazon Amplify 上的下一个 JS 部署失败
- unity3d - 统一编辑器 2021.1.1.19f1 中的 UI 工件
- node.js - mikro-orm 中的 EntityManager、EntityRepository 是什么以及它们之间的区别?
- javascript - 带有 post 方法和 runat 服务器的表单元素
- python-3.x - 如何从 Python 的 Request.post 中获取 TOKEN ID
- docker - 在 Docker 容器中运行整个 Jenkins 管道的方式,从开始到结束?
- wordpress - Google Ad 的错误 (adsbygoogle = window.adsbygoogle || []).push({});
- azure-devops - Azure DevOps 管道运行说明
- vue.js - 剑道编辑器vue如何捕捉vue中的change事件
- shell - 使用AWK计算连续两行中列的百分比变化