Skip to content

Commit

Permalink
Fixed #539 (max recyclable chunk length reduction)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 14, 2019
1 parent 11e128e commit d8b225d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ JSON library.
#508: Add new exception type `InputCoercionException` to be used for failed coercions
like overflow for `int`
#527: Add simple module-info for JDK9+, using Moditect
#539: Reduce max size of recycled byte[]/char[] blocks by `TextBuffer`, `ByteArrayBuilder`

2.9.9 (16-May-2019)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public final class ByteArrayBuilder extends OutputStream
// Size of the first block we will allocate.
private final static int INITIAL_BLOCK_SIZE = 500;

// Maximum block size we will use for individual non-aggregated
// blocks. Let's limit to using 256k chunks.
private final static int MAX_BLOCK_SIZE = (1 << 18);
// Maximum block size we will use for individual non-aggregated blocks.
// For 2.10, let's limit to using 128k chunks (was 256k up to 2.9)
private final static int MAX_BLOCK_SIZE = (1 << 17);

final static int DEFAULT_BLOCK_ARRAY_SIZE = 40;

// Optional buffer recycler instance that we can use for allocating the first block.
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/fasterxml/jackson/core/util/TextBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public final class TextBuffer
final static int MIN_SEGMENT_LEN = 1000;

/**
* Let's limit maximum segment length to something sensible
* like 256k
* Let's limit maximum segment length to something sensible.
* For 2.10, let's limit to using 64kc chunks (128 kB) -- was 256kC/512kB up to 2.9
*/
final static int MAX_SEGMENT_LEN = 0x40000;
final static int MAX_SEGMENT_LEN = 0x10000;

/*
/**********************************************************
Expand Down

0 comments on commit d8b225d

Please sign in to comment.