Packages

o

org.apache.spark.util

SizeEstimator

object SizeEstimator extends Logging

Developer API

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

Annotations
@DeveloperApi()
Source
SizeEstimator.scala
Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SizeEstimator
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def estimate(obj: AnyRef): Long

    Estimate the number of bytes that the given object takes up on the JVM heap.

    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.