Class ObjectSizeUtil


  • public class ObjectSizeUtil
    extends Object
    • Field Detail

      • VERBOSE

        public static boolean VERBOSE
    • Constructor Detail

      • ObjectSizeUtil

        public ObjectSizeUtil()
    • Method Detail

      • getFieldSize

        public static int getFieldSize​(Class clazz)
      • getPointerSize

        public static int getPointerSize()
      • deepSizeOf

        public static ObjectSize deepSizeOf​(Object obj,
                                            IObjectSizeFilter filter,
                                            int maxObjects)
        Calculates full size of object iterating over its hierarchy graph.
        Parameters:
        obj - object to calculate size of
        filter - the filter used to ignore fields or objects
        maxObjects - the max numbers of objects to traverse
        Returns:
        object size
        Throws:
        Exception