mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8316305: Initial buffer size of StackWalker is too small caused by JDK-8285447
Reviewed-by: bchristi
This commit is contained in:
parent
53516aed38
commit
9b65b7ddbe
1 changed files with 6 additions and 7 deletions
|
@ -550,16 +550,15 @@ final class StackStreamFactory {
|
||||||
protected int batchSize(int lastBatchSize) {
|
protected int batchSize(int lastBatchSize) {
|
||||||
if (lastBatchSize == 0) {
|
if (lastBatchSize == 0) {
|
||||||
// First batch, use estimateDepth if not exceed the large batch size
|
// First batch, use estimateDepth if not exceed the large batch size
|
||||||
int initialBatchSize = Math.max(walker.estimateDepth()+RESERVED_ELEMENTS, MIN_BATCH_SIZE);
|
return walker.estimateDepth() == 0
|
||||||
return Math.min(initialBatchSize, LARGE_BATCH_SIZE);
|
? SMALL_BATCH
|
||||||
|
: Math.min(walker.estimateDepth() + RESERVED_ELEMENTS, LARGE_BATCH_SIZE);
|
||||||
} else {
|
} else {
|
||||||
// expand only if last batch was full and the buffer size <= 32
|
// expand only if last batch was full and the buffer size <= 32
|
||||||
// to minimize the number of unneeded frames decoded.
|
// to minimize the number of unneeded frames decoded.
|
||||||
if (lastBatchSize > BATCH_SIZE || !frameBuffer.isFull()) {
|
return (lastBatchSize > BATCH_SIZE || !frameBuffer.isFull())
|
||||||
return lastBatchSize;
|
? lastBatchSize
|
||||||
} else {
|
: Math.min(lastBatchSize*2, BATCH_SIZE);
|
||||||
return Math.min(lastBatchSize*2, BATCH_SIZE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue