【问题标题】:In GCViewer Heap area is not divided into two areas, new and old在 GCViewer Heap area 没有分为两个区域,new 和 old
【发布时间】:2021-06-03 20:11:16
【问题描述】:
我用 GCViewer 分析了一个 GClog,它给出了这个结果。
GCViewer-result
我是 GCViewer 的新手。
据我所知,结果应该分为两个区域,即新的和旧的。
但是没有这样的区域,只有红色区域。
在 View Configuration 中,未选中“Total Heap”。 “Tenured Generation”和“Young Generation”被选中。我怎样才能使这个结果包括新旧区域?
这让我很难分析内存情况。谁能给我建议?
【问题讨论】:
标签:
java
memory-management
garbage-collection
jvm
out-of-memory
【解决方案1】:
我认为这会有所帮助,
与其说是问题,不如说是配置问题。
查看工具报告here
另外,如果您共享您的 JAVA 版本会更容易。 (JDK)
因为您似乎没有使用分代 GC。
更像是并行 GC。所以它可能是JAVA 8。
我认为您使用默认的GC。你应该用-XX:+UseG1GC改变它
我为什么这么说??因为你没有类似的东西:
Tenured Heap (usage/max): ???M (???%) / ???M
Young Heap (usage/max): ???M (???%) / ???M
【解决方案2】:
有同样的问题。
GCViewer 的 G1 日志有问题。
GCViewer 开发者开发者站点在 github:
支持的详细:gc 格式是:...
部分支持 OpenJDK 9 / 10 统一日志记录格式 -Xlog:gc:,以下配置将起作用
-
-Xlog:gc:file="path-to-file" (uses defaults)
-
-Xlog:gc=info:file="path-to-file":tags,uptime,level (minimum configuration needed)
-
-Xlog:gc*=trace:file="path-to-file":tags,time,uptime,level (maximum configuration supported, additional tags ok, but ignored; additional decorations will break parsing)
我将 OpenJDK 11 与 G1 一起使用。
通过设置“-Xlog:gc*=trace”,您可以看到所有 GCViewer 行和区域但缺失:
活动详情选项卡内容很不错。
如果您有兴趣,请参阅 GCViever 源中的 imp/DataReaderUnifiedJvmLogging.java 过滤器以获取有关考虑的 gc 日志行的信息。
Reference for G1GC tuning with advices for log config in problem situations
Reference for the Java unified logging framework usage