简体   繁体   English

内存不足:元空间

[英]Out-of-memory : Metaspace

I am getting Out-of-memory in Metaspace.我在元空间中出现内存不足。 As I understood after googling that Out-of-memory in Metaspace error comes could be due to the leak in Classloader.正如我在谷歌搜索后理解的那样,元空间中的内存不足错误可能是由于 Classloader 中的泄漏。 So, for this I started analyzing the Heap dump in Eclipse MAT and opened 'Class Loader Explorer' which gives following:因此,为此我开始分析 Eclipse MAT 中的堆转储并打开“类加载器资源管理器”,它给出以下内容: 在此处输入图像描述

As I understood from the above data, that com.newrelic.bootstrap.BootstrapAgent$JVMAgentClassLoader is occupying 396,707 instances which were not garbage collected.正如我从上述数据中了解到的那样,com.newrelic.bootstrap.BootstrapAgent$JVMAgentClassLoader 占用了 396,707 个没有被垃圾回收的实例。 Is my understanding correct?我的理解正确吗?

After I selected this row and opend "Path to GC Roots -> exclude all phantom/weak/soft Ref" and I observed that Shallow and Retained Heap are 96 and 231,040 respectively.在我选择了这一行并打开“GC Roots 的路径 -> 排除所有幻象/弱/软 Ref”后,我观察到 Shallow Heap 和 Retained Heap 分别为 96 和 231,040。

After I selected another row in 'Class Loader Explorer' for the class org.apache.felix.framework.BundleWiringImpl$BundleClassLoader and again opend "Path to GC Roots -> exclude all phantom/weak/soft Ref" and now I see this data:在我为 class org.apache.felix.framework.BundleWiringImpl$BundleClassLoader 在“类加载器资源管理器”中选择另一行并再次打开“GC 根路径-> 排除所有幻像/弱/软引用”之后,我看到了这个:

在此处输入图像描述

From this data, is it safe to conclude that in this class there is a leak: com.newrelic.agent.util.DefaultThreadFactory$AgentThreadImpl which is not garbage collected?从这些数据中,是否可以安全地得出结论,在此 class 中存在泄漏:com.newrelic.agent.util.DefaultThreadFactory$AgentThreadImpl 不是垃圾收集的?

If not then please suggest what else I should check?如果没有,请建议我还应该检查什么?

com.newrelic.bootstrap.BootstrapAgent$JVMAgentClassLoader is occupying 396,707 instances which were not garbage collected. com.newrelic.bootstrap.BootstrapAgent$JVMAgentClassLoader 占用了 396,707 个未进行垃圾回收的实例。 Is my understanding correct?我的理解正确吗? That means that com.newrelic.bootstrap.BootstrapAgent$JVMAgentClassLoader has loaded 2627 classes and there are 396,707 instances of those classes.这意味着com.newrelic.bootstrap.BootstrapAgent$JVMAgentClassLoader已经加载了 2627 个类,并且这些类有 396,707 个实例。 In itself, that doesn't look like a problem.就其本身而言,这看起来不是问题。

The Duplicate Classes might be a good query to run to see if a class has been loaded in one classloader, then loaded again (possibly because it was updated), but the old class loader wasn't freed. Duplicate Classes 可能是一个很好的查询,可以运行以查看 class 是否已加载到一个类加载器中,然后再次加载(可能是因为它已更新),但旧的 class 加载器没有被释放。

Is the thread com.newrelic.agent.util.DefaultThreadFactory$AgentThreadImpl supposed to be alive.线程com.newrelic.agent.util.DefaultThreadFactory$AgentThreadImpl应该还活着。 Check with the Thread Overview query to find what it is doing?检查线程概述查询以了解它在做什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM