LUCENE-9483: Disable per-thread caching of buffers for decompression of stored fields. (#1787)

These buffers can use lots of memory when the number of segments,
threads or both is high.
This commit is contained in:
Adrien Grand 2020-09-03 11:37:34 +02:00 committed by GitHub
parent 0a9b660648
commit 0d37e4dc76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 2 deletions

View File

@ -405,8 +405,17 @@ public final class CompressingStoredFieldsReader extends StoredFieldsReader {
// the start pointer at which you can read the compressed documents
private long startPointer;
private final BytesRef spare = new BytesRef();
private final BytesRef bytes = new BytesRef();
private final BytesRef spare;
private final BytesRef bytes;
BlockState() {
if (merging) {
spare = new BytesRef();
bytes = new BytesRef();
} else {
spare = bytes = null;
}
}
boolean contains(int docID) {
return docID >= docBase && docID < docBase + chunkDocs;
@ -536,6 +545,13 @@ public final class CompressingStoredFieldsReader extends StoredFieldsReader {
final int totalLength = offsets[chunkDocs];
final int numStoredFields = this.numStoredFields[index];
final BytesRef bytes;
if (merging) {
bytes = this.bytes;
} else {
bytes = new BytesRef();
}
final DataInput documentInput;
if (length == 0) {
// empty