Skip to content

Commit

Permalink
#12790 add reproducer
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <[email protected]>
  • Loading branch information
lorban committed Feb 17, 2025
1 parent 44c2971 commit e76c3ee
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,30 @@

public class ArrayByteBufferPoolTest
{
@Test
public void testRemoveAndReleaseCompoundPool()
{
int bufferCount = ConcurrentPool.OPTIMAL_MAX_SIZE * 2;
List<RetainableByteBuffer> rbbs = new ArrayList<>();

ArrayByteBufferPool pool = new ArrayByteBufferPool();
for (int i = 0; i < bufferCount; i++)
{
RetainableByteBuffer rbb = pool.acquire(1, false);
rbbs.add(rbb);
}
rbbs.forEach(Retainable::release);
rbbs.clear();

for (int i = 0; i < bufferCount; i++)
{
RetainableByteBuffer rbb = pool.acquire(1, false);
rbbs.add(rbb);
}

rbbs.forEach(pool::removeAndRelease);
}

@Test
public void testDump()
{
Expand Down

0 comments on commit e76c3ee

Please sign in to comment.