File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
proxy/src/main/java/net/md_5/bungee Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,14 @@ public void start() throws Exception
262
262
ResourceLeakDetector .setLevel ( ResourceLeakDetector .Level .DISABLED ); // Eats performance
263
263
}
264
264
265
+ // https://github.com/netty/netty/wiki/Netty-4.2-Migration-Guide
266
+ // The adaptive allocator, the new default allocator since Netty 4.2, has some memory issues.
267
+ // Setting it globally also ensures that any plugins would also use the pooled allocator.
268
+ if ( System .getProperty ( "io.netty.allocator.type" ) == null )
269
+ {
270
+ System .setProperty ( "io.netty.allocator.type" , "pooled" );
271
+ }
272
+
265
273
eventLoops = PipelineUtils .newEventLoopGroup ( 0 , new ThreadFactoryBuilder ().setNameFormat ( "Netty IO Thread #%1$d" ).build () );
266
274
267
275
File moduleDirectory = new File ( "modules" );
Original file line number Diff line number Diff line change 1
1
package net .md_5 .bungee .netty ;
2
2
3
3
import com .google .common .base .Preconditions ;
4
- import io .netty .buffer .PooledByteBufAllocator ;
5
4
import io .netty .channel .Channel ;
6
5
import io .netty .channel .ChannelException ;
7
6
import io .netty .channel .ChannelOption ;
@@ -219,9 +218,6 @@ public boolean accept(Channel ch)
219
218
{
220
219
// IP_TOS is not supported (Windows XP / Windows Server 2003)
221
220
}
222
- // https://github.com/netty/netty/wiki/Netty-4.2-Migration-Guide
223
- // TODO: check for AdaptiveByteBufAllocator
224
- ch .config ().setAllocator ( PooledByteBufAllocator .DEFAULT );
225
221
ch .config ().setWriteBufferWaterMark ( MARK );
226
222
227
223
ch .pipeline ().addLast ( FRAME_DECODER , new Varint21FrameDecoder () );
You can’t perform that action at this time.
0 commit comments