heapdump 上对象的保留大小是多少? [英] What is retained size for an object on heapdump?

查看:24
本文介绍了heapdump 上对象的保留大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在 Netbeans (6.7) 中增加了对 Profiler 的使用,这是一个很棒的工具.

I've recently increase my use of the Profiler in Netbeans (6.7), this is a great tool.

不过我有一个问题.进行堆转储时,在摘要页面(预期窗口)上可以通过保留大小找到最大的对象".

I have a question however. When taking a heap dump, on the summary page (expect window) it is possible to 'find the biggest objects by retained size'.

这个值是什么以及它如何用于分析内存使用情况?

What is this value and how is it used to analyze memory usage?

推荐答案

对象的保留大小是该对象从垃圾回收中保留的内存量.

The retained size for an object is the quantity of memory this objects preserves from garbage collection.

正式定义是对象的大小加上仅由第一个对象引用的所有对象的大小,递归地".

The formal definition is "the size of the object plus the size of all objects referenced only by the first object, recursively".

有关什么是保留内存的更多解释,请参阅这篇文章.

For more explanations about what the retained memory is, see this article.

一种简单的记住方法是,保留的内存是如果该对象被取消引用可以被垃圾回收的所有内存.

One easy way to remember it is that the retained memory is all the memory that could be garbage collected if this object was dereferenced.

这篇关于heapdump 上对象的保留大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆