mirror of https://github.com/apache/lucene.git
SOLR-7971: Reduce memory allocated by JavaBinCodec to encode large strings by an amount equal to the string.length()
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1697726 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d5d058df69
commit
2330786c5a
|
@ -168,6 +168,10 @@ Optimizations
|
|||
are more efficient especially when cluster has a mix of collections in stateFormat=1
|
||||
and stateFormat=2. (Scott Blum, shalin)
|
||||
|
||||
* SOLR-7971: Reduce memory allocated by JavaBinCodec to encode large strings by an amount
|
||||
equal to the string.length().
|
||||
(yonik, Steve Rowe, shalin)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -614,7 +614,7 @@ public class JavaBinCodec {
|
|||
return;
|
||||
}
|
||||
int end = s.length();
|
||||
int maxSize = end * 4;
|
||||
int maxSize = end * 3; // 3 is enough, see SOLR-7971
|
||||
if (bytes == null || bytes.length < maxSize) bytes = new byte[maxSize];
|
||||
int sz = ByteUtils.UTF16toUTF8(s, 0, end, bytes, 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue