在 JDK Mission Control 中查看的 JFR 结果中的总分配意味着什么?

问题描述 投票:0回答:1

我遇到了一个奇怪的情况,我试图确定某些进程重新启动的根本原因。我们收集 JFR 一段时间,我发现堆并没有随着时间的推移而增长。堆的最大大小始终保持在 2 GiB 以下。

但是,我发现一个类

byte[]
的总分配量约为 180+ GiB,而总物理内存仅为 128 GB。同一类别的总分配比例为58.4%。然而,最大实时大小为 171 MiB。

此外,我发现“已用大小”也相当高(125 GiB)。我在 JFR 配置文件的自动分析部分看到了这条消息:

The maximum amount of used memory was 99.7 % of the physical memory available.
The maximum amount of memory used was 125 GiB. This is 99.7 % of the 126 GiB of physical memory available. Having little free memory may lead to swapping, which is very expensive. To avoid this, either decrease the memory usage or increase the amount of available memory.

我在这里很困惑。总分配量是指物理内存中的数据量吗?或者它只是已分配但此后被垃圾回收的内存总量?

memory-management memory-leaks allocation jfr jmc
1个回答
0
投票

该消息是由“物理内存不足”规则生成的。您可以通过查看消息文本和实现来验证规则。

据我所知,它使用 OS_MEMORY_SUMMARY 事件,而不是与对象分配相关的事件。

© www.soinside.com 2019 - 2024. All rights reserved.