Class MemoryFootprint


  • public class MemoryFootprint
    extends java.lang.Object
    Calculate the memory footprint of various objects.
    • Constructor Summary

      Constructors 
      Constructor Description
      MemoryFootprint()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long getObjectSize​(java.lang.Object o)
      Get the number of bytes required for the given object.
      static void main​(java.lang.String... a)
      Run just this test.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MemoryFootprint

        public MemoryFootprint()
    • Method Detail

      • main

        public static void main​(java.lang.String... a)
        Run just this test.
        Parameters:
        a - ignored
      • getObjectSize

        public static long getObjectSize​(java.lang.Object o)
        Get the number of bytes required for the given object. This method only works if the agent is set.
        Parameters:
        o - the object
        Returns:
        the number of bytes required