我需要帮助使用MAT找到我的内存泄漏 [英] I need help finding my memory leak using MAT

查看:141
本文介绍了我需要帮助使用MAT找到我的内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MAT来比较两个堆转储。我每天都在堆垃圾堆,每天增加约200兆。我认为泄漏与java.util.zip有关,因为该表显示了什么,也因为我们最近添加了一个新的进程来拉链和解压缩很多文件。 (见图)

I'm using the MAT to compare two heap dumps. I've been taking a heap dump each day and it's growing by about 200 megs each day. I think the leak is associated with java.util.zip because of what the table shows and also because we added a new process recently that zips and unzips a lot of files. (see image)

此时我打开支配者并过滤。 Inflater 。这产生了一个庞大的java.util.zip.Inflater列表。现在我想看看是什么让这些打开,所以我选择了一个并运行了GC根路径,不包括弱引用和软引用(见图)。

At this point I open the dominator and filtered for .Inflater. That produced a large list of java.util.zip.Inflater. Now I want to see what's holding these open so I picked one and ran the Path to GC root excluding weak and soft references (see image).

看起来这与罐子膨胀有关,与我的过程无关。此时我陷入困境并需要一些建议。

It looks like this has to do with the jar inflation and nothing to do with my process. At this point I'm stuck and need some suggestions.

编辑1

Sean询问了ThreadLocals。如果你看看没有过滤器的dominator_tree,你会发现java.lang.ApplicationShutdownHooks是堆的58%。如果我展开其中一些条目,你会发现它们似乎在ThreadLocalMap中。我怎么能找到把它们放在那里的东西?

Sean asked about the ThreadLocals. If you look at the dominator_tree with no filter you see that java.lang.ApplicationShutdownHooks is 58% of the heap. If I expand some of those entries you can see that they seem to be in the ThreadLocalMap. How would I find what put them there?

编辑2

肖恩的评论让我走上了正确的轨道。我正在使用Glassfish v 2.0,它有一个内存泄漏。它不断创建新的LogManagers并将它们添加到ApplicationShutdownHooks集合。

Sean's comment put me on the correct track. I'm using Glassfish v 2.0 and it has a memory leak. It continually creates new LogManagers and adds them to the ApplicationShutdownHooks collection.

我通过破解ApplicationShutdownHooks并手动从集合中删除对象解决了这个问题。

I worked around the issue by cracking open the ApplicationShutdownHooks and manually removing the objects from the collection.

推荐答案

肖恩的评论让我走上了正确的轨道。我正在使用Glassfish v 2.0,它有内存泄漏。它不断创建新的LogManagers并将它们添加到ApplicationShutdownHooks集合。

Sean's comment put me on the correct track. I'm using Glassfish v 2.0 and it has a memory leak. It continually creates new LogManagers and adds them to the ApplicationShutdownHooks collection.

我通过破解ApplicationShutdownHooks并手动从集合中删除对象解决了这个问题。

I worked around the issue by cracking open the ApplicationShutdownHooks and manually removing the objects from the collection.

这篇关于我需要帮助使用MAT找到我的内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆