Interface Accountable

All Known Subinterfaces:
FSTReader, QuantizedVectorsReader
All Known Implementing Classes:
AbstractPagedMutable, Automaton, AutomatonQuery, BitDocIdSet, BitSet, BufferingKnnVectorsWriter, ByteBlockPool, ByteBuffersDataInput, ByteBuffersDataOutput, ByteRunAutomaton, BytesRefArray.SortState, BytesRefBlockPool, BytesRefHash, CharacterRunAutomaton, CharHashSet, CharObjectHashMap, CombinedFieldQuery, CompiledAutomaton, DocIdSet, DocsWithFieldSet, FixedBitSet, FlatFieldVectorsWriter, FlatVectorsReader, FlatVectorsWriter, FloatArrayList, FrequencyTrackingRingBuffer, FST, GrowableWriter, IndexWriter, IntArrayList, IntDoubleHashMap, IntFloatHashMap, IntHashSet, IntIntHashMap, IntLongHashMap, IntObjectHashMap, KnnFieldVectorsWriter, KnnVectorsWriter, LongArrayList, LongBitSet, LongFloatHashMap, LongHashSet, LongIntHashMap, LongObjectHashMap, LRUQueryCache, LRUQueryCache.CacheAndCount, Lucene104ScalarQuantizedVectorsReader, Lucene104ScalarQuantizedVectorsWriter, Lucene90CompressingStoredFieldsWriter, Lucene90CompressingTermVectorsWriter, Lucene99FlatVectorsReader, Lucene99FlatVectorsWriter, Lucene99HnswVectorsReader, Lucene99HnswVectorsWriter, MaxSizedFloatArrayList, MaxSizedIntArrayList, MonotonicBlockPackedReader, NFARunAutomaton, NotDocIdSet, NRTCachingDirectory, OffHeapFSTStore, OnHeapFSTStore, OnHeapHnswGraph, OrdinalMap, PackedInts.Mutable, PackedInts.NullReader, PackedInts.Reader, PackedLongValues, PackedLongValues.Builder, PagedBytes, PagedBytes.Reader, PagedGrowableWriter, PagedMutable, PointInSetQuery, PrefixCodedTerms, PrefixQuery, RegexpQuery, RoaringDocIdSet, RunAutomaton, SparseFixedBitSet, StoredFieldsWriter, Term, TermInSetQuery, TermRangeQuery, TermVectorsWriter, Transition, WildcardQuery

public interface Accountable
An object whose JVM heap memory usage can be computed.

Implementations should only account for memory allocated on the Java heap (i.e. memory managed by the JVM garbage collector). Off-heap resources such as memory-mapped files or native direct buffers should not be included; those should be tracked separately if needed (see e.g. KnnVectorsReader.getOffHeapByteSize(org.apache.lucene.index.FieldInfo)).

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Accountable
    An accountable that always returns 0
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns nested resources of this class.
    long
    Returns an estimate of the JVM heap memory used by this object in bytes.
  • Field Details

    • NULL_ACCOUNTABLE

      static final Accountable NULL_ACCOUNTABLE
      An accountable that always returns 0
  • Method Details

    • ramBytesUsed

      long ramBytesUsed()
      Returns an estimate of the JVM heap memory used by this object in bytes. The method name uses "ram" for historical reasons; only JVM heap memory should be reported. Off-heap resources such as memory-mapped files or native direct buffers should not be included. Negative values are illegal.
    • getChildResources

      default Collection<Accountable> getChildResources()
      Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).
      See Also: