Change default of io.netty.allocator.useCacheForAllThreads to false (#8991)

Motivation:

We currently use a thread local cache for all threads which often is suprising to users as it may result in a lot of memory usage if they allocate buffers from outside the EventLoop in different threads. We should better not do this by default to keep suprises to a minimum. Users that need the performance and know what they are doing can still change this.

Modifications:

Change io.netty.allocator.useCacheForAllThreads to false by default

Result:

Related to https://github.com/netty/netty/issues/8536.
This commit is contained in:
Norman Maurer 2019-04-01 19:43:19 +02:00 committed by GitHub
parent 07244a194f
commit 78c4abbfb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ public class PooledByteBufAllocator extends AbstractByteBufAllocator implements
"io.netty.allocation.cacheTrimIntervalMillis", 0);
DEFAULT_USE_CACHE_FOR_ALL_THREADS = SystemPropertyUtil.getBoolean(
"io.netty.allocator.useCacheForAllThreads", true);
"io.netty.allocator.useCacheForAllThreads", false);
DEFAULT_DIRECT_MEMORY_CACHE_ALIGNMENT = SystemPropertyUtil.getInt(
"io.netty.allocator.directMemoryCacheAlignment", 0);

View File

@ -117,7 +117,7 @@ public class PooledByteBufAllocatorTest extends AbstractByteBufAllocatorTest<Poo
@Test
public void testArenaMetricsCache() {
testArenaMetrics0(new PooledByteBufAllocator(true, 2, 2, 8192, 11, 1000, 1000, 1000), 100, 1, 1, 0);
testArenaMetrics0(new PooledByteBufAllocator(true, 2, 2, 8192, 11, 1000, 1000, 1000, true, 0), 100, 1, 1, 0);
}
@Test