zoukankan      html  css  js  c++  java
  • Shallow, Retained, and Deep Size

    原文:https://dzone.com/articles/shallow-retained-and-deep-size

    If you ever worked with heap analysis, you might have encountered terms such as shallow, retained, and deep size of an object. It doesn’t really matter if we’re talking about analyzing a JVM heap dump with VisualVM or a JavaScript heap snapshot with Chrome DevTools – the terms are the same. The difference between shallow, retained, and deep size is rather straightforward and it can be easily depicted with the following images:

    Image title

    Shallow size – size of the object itself including only references to other objects, without objects which are referenced.

    Image title

    Retained size – size of the object including references to other objects and objects which are referenced, but are not shared with any other objects. In other words, the retained memory of an object is the amount of memory that would be freed if the object A was eligible to be collected by GC. Memory of the object E couldn’t be freed because it is also an instance variable of object B. 

    Image title

    Deep size – size of the object including references to other objects and objects which are referenced, even if they are shared with other objects.

  • 相关阅读:
    [ Openstack ] Openstack-Mitaka 高可用之 环境初始化
    [ Openstack ] OpenStack-Mitaka 高可用之 概述
    Swift
    Swift
    报错
    归并排序
    堆排序
    插入排序
    早睡早起身体好
    用于查询的日期类型转换帮助类
  • 原文地址:https://www.cnblogs.com/kelisi-king/p/12071484.html
Copyright © 2011-2022 走看看