Skip to content

Apache Lucene open-source search software

LUCENE-10111: Missing calculating the bytes used of DocsWithFieldSet in NormValuesWriter (#307)

Lu Xuganga7bddfaacc24
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index d7a8d5960f5..cc8e21d95ae 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -420,6 +420,9 @@ Bug Fixes
* LUCENE-10110: MultiCollector now handles single leaf collector that wants to skip low-scoring hits
but the combined score mode doesn't allow it. (Jim Ferenczi)
+* LUCENE-10111: Missing calculating the bytes used of DocsWithFieldSet in NormValuesWriter.
+ (Lu Xugang)
+
Build
---------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/NormValuesWriter.java b/lucene/core/src/java/org/apache/lucene/index/NormValuesWriter.java
index 202db7e6646..8fe73768f61 100644
--- a/lucene/core/src/java/org/apache/lucene/index/NormValuesWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/NormValuesWriter.java
@@ -60,7 +60,7 @@ class NormValuesWriter {
}
private void updateBytesUsed() {
- final long newBytesUsed = pending.ramBytesUsed();
+ final long newBytesUsed = pending.ramBytesUsed() + docsWithField.ramBytesUsed();
iwBytesUsed.addAndGet(newBytesUsed - bytesUsed);
bytesUsed = newBytesUsed;
}