From a7bddfaacc24aae1d9bb97c8c4e87533d85ae42c Mon Sep 17 00:00:00 2001 From: Lu Xugang Date: Wed, 22 Sep 2021 13:44:30 +0800 Subject: [PATCH] LUCENE-10111: Missing calculating the bytes used of DocsWithFieldSet in NormValuesWriter (#307) --- lucene/CHANGES.txt | 3 +++ .../src/java/org/apache/lucene/index/NormValuesWriter.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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; }