[英]Java: how to find all references to a specific class instance
I have a Java application where a specific object is the principal reason of RAM occupation, this is ok. 我有一个Java应用程序,其中特定对象是RAM占用的主要原因,这没关系。 Application logic has to drop this object instance and create a new one. 应用程序逻辑必须删除该对象实例并创建一个新的实例。 I suspect old instance is kept alive by some reference. 我怀疑某些实例可以使旧实例保留下来。
Is there a way to list all references of a specific class instance using Eclipse debug or anything else? 有没有一种方法可以使用Eclipse调试或其他方法列出特定类实例的所有引用?
Using Eclipse Memory Analyzer plugin (org.eclipse.mat.feature.feature.group): 使用Eclipse Memory Analyzer插件(org.eclipse.mat.feature.feature.group):
eclispe.ini
to add more memory (if you don't have enough RAM you may instead create the memory dump using jvisualvm then close the app and start eclipse with increased -Xmx
) Eclipse将需要足够的内存来处理它,通常与所分析的应用程序的内存量相同-您可能需要更改eclispe.ini
以添加更多的内存(如果没有足够的RAM,则可以使用jvisualvm创建内存转储,然后关闭应用程序,并使用增加的-Xmx
开始eclipse)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.