From 15863bdaef6e95fbb3b23dd26e2a7327b080a978 Mon Sep 17 00:00:00 2001 From: Redned Date: Sun, 18 Jul 2021 16:24:55 -0500 Subject: [PATCH] Disable netty's resource leak detector if no level is set --- .../main/java/org/geysermc/connector/GeyserConnector.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java index 173e41573..98dfbc5ce 100644 --- a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java +++ b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java @@ -34,6 +34,7 @@ import com.nukkitx.network.util.EventLoops; import com.nukkitx.protocol.bedrock.BedrockServer; import io.netty.channel.epoll.Epoll; import io.netty.channel.kqueue.KQueue; +import io.netty.util.ResourceLeakDetector; import lombok.Getter; import lombok.Setter; import org.geysermc.common.PlatformType; @@ -125,6 +126,10 @@ public class GeyserConnector { private Metrics metrics; private GeyserConnector(PlatformType platformType, GeyserBootstrap bootstrap) { + if (System.getProperty("io.netty.leakDetection.level") == null) { + ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.DISABLED); // Can eat performance + } + long startupTime = System.currentTimeMillis(); instance = this;