简体   繁体   English

Java Yourkit Profiler显示5K + char []对象没有被垃圾收集,如何辨别罪魁祸首?

[英]Java Yourkit Profiler showing 5K+ char[] objects not getting garbage Collected, how can I tell what class is the culprit?

I have an RCP application and there is a slow memory leak and I recently started using YourKit Profiler which seems to be the best app out there for this. 我有一个RCP应用程序,内存泄漏很慢,我最近开始使用YourKit Profiler,它似乎是最好的应用程序。 The question I have, is I see that over 20% of my objects char[] arrays and what I want to figure out is what class/method in my app is created all these instances as they do not seem to getting garbage collected. 我的问题是,我看到超过20%的对象char []数组,我想弄清楚的是,在所有这些实例中,我的应用程序都创建了什么类/方法,因为这些实例似乎没有被垃圾收集。 I am connected to a messaging server and consuming probably 500 text messages a second, but I am having a tough time using Yourkit to find the gradual memory leak. 我已连接到消息传递服务器,并且每秒可能消耗500条文本消息,但是使用Yourkit来查找逐渐的内存泄漏却很困难。 Thanks for any help. 谢谢你的帮助。

As a YourKit developer, I can recommend to record object allocations as it's described here http://www.yourkit.com/docs/11/help/allocations.jsp 作为YourKit开发人员,我可以建议记录对象分配,如此处http://www.yourkit.com/docs/11/help/allocations.jsp所述

After that you'll see the places where each particular object was created. 之后,您将看到创建每个特定对象的位置。 Please note, that allocation recording adds (sometime significant) profiling overhead. 请注意,分配记录增加了(有时是很大的)性能分析开销。

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

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