New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable PooledByteBufAllocator to work, even without a cache #7195

Closed
wants to merge 1 commit into
base: 4.1
from

Conversation

Projects
None yet
2 participants
@carl-mastrangelo
Member

carl-mastrangelo commented Sep 8, 2017

Motivation:
useCacheForAllThreads may be false which disables memory caching
on non netty threads. Setting this argument or the system property
makes it impossible to use PooledByteBufAllocator.

Modifications:

Delayed the check of freeSweepAllocationThreshold in
PoolThreadCache to after it knows there will be any caches in
use. Additionally, check if the caches will have any data in them
(rather than allocating a 0-length array).

A test case is also added that fails without this change.

Results:

Fixes #7194

Enable PooledByteBufAllocator to work, event without a cache
Motivation:
`useCacheForAllThreads` may be false which disables memory caching
on non netty threads.  Setting this argument or the system property
makes it impossible to use `PooledByteBufAllocator`.

Modifications:

Delayed the check of `freeSweepAllocationThreshold` in
`PoolThreadCache` to after it knows there will be any caches in
use.  Additionally, check if the caches will have any data in them
(rather than allocating a 0-length array).

A test case is also added that fails without this change.

Results:

Fixes #7194

@carl-mastrangelo carl-mastrangelo changed the title from Enable PooledByteBufAllocator to work, event without a cache to Enable PooledByteBufAllocator to work, even without a cache Sep 8, 2017

@normanmaurer

This comment has been minimized.

Show comment
Hide comment
@normanmaurer

normanmaurer Sep 8, 2017

Member

Cherry-picked into 4.1 (d2cb51b) and 4.0 (6748c3b).

thanks @carl-mastrangelo

Member

normanmaurer commented Sep 8, 2017

Cherry-picked into 4.1 (d2cb51b) and 4.0 (6748c3b).

thanks @carl-mastrangelo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment