简体   繁体   English

使用内存分析器在Java heapdump中查找打开的文件

[英]Find open files in Java heapdump using memory analyzer

I have a java heapdump which I've opened in Memory Analyzer. 我有一个在内存分析器中打开的Java heapdump。 Is there some way in memory analyzer (mat) to query for open file handles? 内存分析器(mat)中是否有某种查询打开文件句柄的方法? I would like to identify exactly which class opened the file and holds an active reference to the file. 我想确切地确定哪个类打开了文件并拥有对该文件的有效引用。

I've not done this (so open to flaming) but, I believe the yourkit file probe should be able to track open connections - in a running Java process. 我没有做过(很容易燃烧),但我相信yourkit文件探针应该能够在运行中的Java进程中跟踪打开的连接。

As I say, not done it but I have done something similar with jdbc leaks and the database probe and it works on events (eg Tracks based on respective method calls). 就像我说的,没有做,但是我做了一些与jdbc泄漏和数据库探测类似的事情,并且它可以处理事件(例如基于各自方法调用的Tracks)。 You should be able to see the stack trace where open and close occur (if it is akin to the database probe). 您应该能够看到发生打开和关闭的堆栈跟踪(如果它类似于数据库探针)。

YourKit is a paid for app but you can trial it. YourKit是付费的应用程序,但您可以试用。

看一下File Leak Detector ,它是您附加到Java进程的Java代理。

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

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