mirror of https://github.com/apache/lucene.git
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:
parent
0a9b660648
commit
0d37e4dc76
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue