LUCENE-6242: Fix SparseFixedBitSet ram usage estimation when object alignment is different from 8.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1659273 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrien Grand 2015-02-12 14:24:57 +00:00
parent ef71f3d1bd
commit ccb111b48e
2 changed files with 4 additions and 1 deletions

View File

@ -50,6 +50,9 @@ Bug Fixes
* LUCENE-6190: Spatial pointsOnly flag on PrefixTreeStrategy shouldn't switch all predicates to
Intersects. (David Smiley)
* LUCENE-6242: Ram usage estimation was incorrect for SparseFixedBitSet when
object alignment was different from 8. (Uwe Schindler, Adrien Grand)
Optimizations
* LUCENE-6183, LUCENE-5647: Avoid recompressing stored fields

View File

@ -184,7 +184,7 @@ public class SparseFixedBitSet extends BitSet implements Bits, Accountable {
newBitArray[o] = 1L << i;
System.arraycopy(bitArray, o, newBitArray, o + 1, bitArray.length - o);
bits[i4096] = newBitArray;
ramBytesUsed += (newSize - bitArray.length) * RamUsageEstimator.NUM_BYTES_LONG;
ramBytesUsed += RamUsageEstimator.sizeOf(newBitArray) - RamUsageEstimator.sizeOf(bitArray);
}
++nonZeroLongCount;
}