Skip to content

Commit

Permalink
change the default value of retainedHeapMemory and retainedDirectMemo…
Browse files Browse the repository at this point in the history
…ry in the Tracking pool to use a retaining variant

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
  • Loading branch information
lorban committed Jul 15, 2024
1 parent 5f94238 commit ee4b274
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,21 +349,27 @@ public static class Tracking extends ArrayByteBufferPool
{
public Tracking()
{
// Do not call super as we want to change the default value of retainedHeapMemory and retainedDirectMemory.
this(-1, -1, -1, -1, 0, 0);
}

public Tracking(int minCapacity, int factor, int maxCapacity)
{
super(minCapacity, factor, maxCapacity);
// Do not call super as we want to change the default value of retainedHeapMemory and retainedDirectMemory.
this(minCapacity, factor, maxCapacity, -1, 0, 0);
}

public Tracking(int minCapacity, int factor, int maxCapacity, int maxQueueLength)
{
super(minCapacity, factor, maxCapacity, maxQueueLength);
// Do not call super as we want to change the default value of retainedHeapMemory and retainedDirectMemory.
this(minCapacity, factor, maxCapacity, maxQueueLength, 0, 0);
}

public Tracking(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory)
{
super(minCapacity, factor, maxCapacity, maxBucketSize, maxHeapMemory, maxDirectMemory);
// Set retainedHeapMemory and retainedDirectMemory to the same values as maxHeapMemory and maxDirectMemory respectively
// to default to a retaining pool.
super(minCapacity, factor, maxCapacity, maxBucketSize, maxHeapMemory, maxDirectMemory, maxHeapMemory, maxDirectMemory);
}

public Tracking(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory, long retainedHeapMemory, long retainedDirectMemory)
Expand Down

0 comments on commit ee4b274

Please sign in to comment.