Skip to content

Commit 8391b97

Browse files
Recovery buffer size 16B smaller (#50100)
G1GC will use humongous allocations when an allocation exceeds half the chosen region size, which is minimum 1MB. By reducing the recovery buffer size by 16 bytes we ensure that the recovery buffer is never allocated as a humongous allocation.
1 parent 620b84c commit 8391b97

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/org/elasticsearch/indices/recovery/RecoverySettings.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public class RecoverySettings {
8181
INDICES_RECOVERY_INTERNAL_LONG_ACTION_TIMEOUT_SETTING::get, TimeValue.timeValueSeconds(0),
8282
Property.Dynamic, Property.NodeScope);
8383

84-
public static final ByteSizeValue DEFAULT_CHUNK_SIZE = new ByteSizeValue(512, ByteSizeUnit.KB);
84+
// choose 512KB-16B to ensure that the resulting byte[] is not a humongous allocation in G1.
85+
public static final ByteSizeValue DEFAULT_CHUNK_SIZE = new ByteSizeValue(512 * 1024 - 16, ByteSizeUnit.BYTES);
8586

8687
private volatile ByteSizeValue maxBytesPerSec;
8788
private volatile int maxConcurrentFileChunks;

0 commit comments

Comments
 (0)