From fa828eba315d72be26f2b0d346bad2a6a1ed0017 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 13 Apr 2015 09:51:11 +1000 Subject: [PATCH] Allow using properties to change leak detection level. --- proxy/src/main/java/net/md_5/bungee/BungeeCord.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java index bb1c0d30..5b320508 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -227,7 +227,10 @@ public class BungeeCord extends ProxyServer { System.setProperty( "java.net.preferIPv4Stack", "true" ); // Minecraft does not support IPv6 System.setProperty( "io.netty.selectorAutoRebuildThreshold", "0" ); // Seems to cause Bungee to stop accepting connections - ResourceLeakDetector.setEnabled( false ); // Eats performance + if ( System.getProperty( "io.netty.leakDetectionLevel" ) == null ) + { + ResourceLeakDetector.setLevel( ResourceLeakDetector.Level.DISABLED ); // Eats performance + } eventLoops = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty IO Thread #%1$d" ).build() );