diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java index 43f4842bf1..e4017fd960 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java @@ -172,8 +172,10 @@ public class NettyConnector extends AbstractConnector { public static final Map DEFAULT_CONFIG; static { - // Disable resource leak detection for performance reasons by default - ResourceLeakDetector.setLevel(Level.DISABLED); + // Disable default Netty leak detection if the Netty leak detection level system properties are not in use + if (System.getProperty("io.netty.leakDetectionLevel") == null && System.getProperty("io.netty.leakDetection.level") == null) { + ResourceLeakDetector.setLevel(Level.DISABLED); + } // Set default Configuration Map config = new HashMap<>();