Skip to content

Commit

Permalink
#8161 add memory heuristic to ArrayRetainableByteBufferPool
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
  • Loading branch information
lorban committed Jun 14, 2022
1 parent b383f53 commit 00e33d6
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -47,12 +47,12 @@ public class ArrayRetainableByteBufferPool implements RetainableByteBufferPool,

public ArrayRetainableByteBufferPool()
{
this(0, -1, -1, Integer.MAX_VALUE, -1L, -1L);
this(0, -1, -1, Integer.MAX_VALUE);
}

public ArrayRetainableByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxBucketSize)
{
this(minCapacity, factor, maxCapacity, maxBucketSize, -1L, -1L);
this(minCapacity, factor, maxCapacity, maxBucketSize, 0L, 0L);
}

public ArrayRetainableByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory)
Expand Down Expand Up @@ -91,8 +91,8 @@ protected ArrayRetainableByteBufferPool(int minCapacity, int factor, int maxCapa
_maxCapacity = maxCapacity;
_direct = directArray;
_indirect = indirectArray;
_maxHeapMemory = maxHeapMemory;
_maxDirectMemory = maxDirectMemory;
_maxHeapMemory = (maxHeapMemory != 0L) ? maxHeapMemory : Runtime.getRuntime().maxMemory() / 4;
_maxDirectMemory = (maxDirectMemory != 0L) ? maxDirectMemory : Runtime.getRuntime().maxMemory() / 4;
_bucketIndexFor = bucketIndexFor;
}

Expand Down

0 comments on commit 00e33d6

Please sign in to comment.