java垃圾收集器 - “get”被删除的对象 [英] java garbage collector - "get" the deleted objects
问题描述
有没有可能看到哪些对象将被垃圾收集器删除?我不需要该对象的内容,但该对象的类是必要的。
我尝试写一个实时应用程序,它创建并删除了很多对象,过了一段时间后应用程序变慢了。目前我不确定这是我的代码还是来自外部库的问题。所以完美的是一个输出,它标识所有已经被删除的类以及它们的数量(有多少个这些对象已被删除)。
我希望有人能帮助我。
最好,
Michael
您可以尝试使用VisualVM监视您的应用程序。有一个插件提供垃圾收集器活动的信息。
noreferrer> http://visualvm.java.net/plugins.htmlis there a possibility to see which objects will be removed with the garbage collector? I do not need the content of the object, but the class of the object is necessary.
I try to write a real time application, which creates and deletes a lot of objects and after a while the application slow down. At the moment I'm not sure whether it's a problem of my code or from the external libraries. So perfect would be an output, which identifies all classes, which has been removed, together with their "count" (how many of this objects has been removed).
I hope somebody can help me.
Best, Michael
You could try monitoring your application with VisualVM. There is a plugin that gives info on the garbage collector activity.
http://visualvm.java.net/plugins.html
这篇关于java垃圾收集器 - “get”被删除的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!