Class MemoryUtils

java.lang.Object
org.pepsoft.util.MemoryUtils

public class MemoryUtils extends Object
  • Constructor Details

    • MemoryUtils

      public MemoryUtils()
  • Method Details

    • getSize

      public static long getSize(Object object, Set<Class<?>> stopAt)
      Get the memory used by a particular object instance in bytes. To prevent runaway
      Parameters:
      object - The object of which to determine the memory used.
      stopAt - Types of references which should not be followed.
      Returns:
      The number of bytes of RAM used by the object, or -1 if the size could not be determined.