IBM 堆分析器 - 最终确定方法
以下屏幕显示取自 IBM Heap Analyzer。
我想了解“使用 Finalize() 方法的对象数量”和“垃圾数量”之间的区别实现 Finalize() 方法的对象”。
The following screenshow is taken from IBM Heap Analyzer.
I want to understand the difference between 'Number of Objects with Finalize() method' and 'Number of garbage objects implementing finalize() method'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我了解,“具有 Finalize() 方法的对象数量”意味着堆上有 5 个具有 Finalize 方法的活动对象。如果你有很多这样的东西,那么它们本身不会造成任何伤害 - 直到它们必须被 GC 处理。所以这暗示着一些事情正在酝酿之中。
值“实现 Finalize() 方法的垃圾对象的数量”表示有多少对象具有
finalize()
方法已被垃圾收集。与上面的数字不同,这些都是付出了代价的物体。如果第一个数字很小并且这些对象寿命很长,则无需担心。
如果第一个数字很小而第二个数字很大,则意味着您有许多具有 Finalize() 方法的短期对象,这可能会成为一个问题,因为它会使 GC 运行成本更高。
As I understand it, "Number of Objects with Finalize() method" means there are 5 live objects on the heap which have a finalize method. If you have many of those, then they don't do any harm as such - until they have to be GC'd. So it's a hint of something brewing on the horizon.
The value "Number of garbage objects implementing finalize() method" says how many objects have been garbage collected that do have a
finalize()
method. Unlike the number above, these are objects which have paid the price.If the first number is small and those objects are long lived, there is no need to worry.
If the first number is small and the second number is high, that means you have many short lived objects with a
finalize()
method and this could be a problem because it makes GC runs more expensive.