File tree Expand file tree Collapse file tree
core/src/java/org/apache/lucene/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -331,6 +331,8 @@ Improvements
331331* GITHUB#15989: DocValuesRangeIterator always tries to use skipper-based block iteration
332332 as its approximation. (Alan Woodward)
333333
334+ * GITHUB#16000: Clarify that Accountable#ramBytesUsed() reports JVM heap memory only. (Luca Cavanna)
335+
334336Optimizations
335337---------------------
336338* GITHUB#15861: Optimise PhraseScorer by short circuiting non competitive documents in TOP_SCORES mode. (Prithvi S)
Original file line number Diff line number Diff line change 2020import java .util .Collections ;
2121
2222/**
23- * An object whose RAM usage can be computed.
23+ * An object whose JVM heap memory usage can be computed.
24+ *
25+ * <p>Implementations should only account for memory allocated on the Java heap (i.e. memory managed
26+ * by the JVM garbage collector). Off-heap resources such as memory-mapped files or native direct
27+ * buffers should not be included; those should be tracked separately if needed (see e.g. {@link
28+ * org.apache.lucene.codecs.KnnVectorsReader#getOffHeapByteSize}).
2429 *
2530 * @lucene.internal
2631 */
2732public interface Accountable {
2833
29- /** Return the memory usage of this object in bytes. Negative values are illegal. */
34+ /**
35+ * Returns an estimate of the JVM heap memory used by this object in bytes. The method name uses
36+ * "ram" for historical reasons; only JVM heap memory should be reported. Off-heap resources such
37+ * as memory-mapped files or native direct buffers should not be included. Negative values are
38+ * illegal.
39+ */
3040 long ramBytesUsed ();
3141
3242 /**
You can’t perform that action at this time.
0 commit comments