@InterfaceAudience.Private public interface HeapSize
Useful for sizing caches. Its a given that implementation approximations do not account for 32 vs 64 bit nor for different VM implementations.
An Object's size is determined by the non-static data members in it, as well as the fixed
Object
overhead.
For example:
public class SampleObject implements HeapSize { int[] numbers; int x; }
Modifier and Type | Method and Description |
---|---|
long |
heapSize()
Return the approximate 'exclusive deep size' of implementing object.
|
long heapSize()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.