Class SizeEstimator

Object
org.apache.spark.util.SizeEstimator

public class SizeEstimator extends Object
:: DeveloperApi :: Estimates the sizes of Java objects (number of bytes of memory they occupy), for use in memory-aware caches.

Based on the following JavaWorld article: https://www.infoworld.com/article/2077408/sizeof-for-java.html

  • Constructor Details

    • SizeEstimator

      public SizeEstimator()
  • Method Details

    • estimate

      public static long estimate(Object obj)
      Estimate the number of bytes that the given object takes up on the JVM heap. The estimate includes space taken up by objects referenced by the given object, their references, and so on and so forth.

      This is useful for determining the amount of heap space a broadcast variable will occupy on each executor or the amount of space each object will take when caching objects in deserialized form. This is not the same as the serialized size of the object, which will typically be much smaller.

      Parameters:
      obj - (undocumented)
      Returns:
      (undocumented)
    • org$apache$spark$internal$Logging$$log_

      public static org.slf4j.Logger org$apache$spark$internal$Logging$$log_()
    • org$apache$spark$internal$Logging$$log__$eq

      public static void org$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1)