diff --git a/common/src/main/java/io/netty/util/ResourceLeakDetector.java b/common/src/main/java/io/netty/util/ResourceLeakDetector.java index 3872c07d1c..c29320adb7 100644 --- a/common/src/main/java/io/netty/util/ResourceLeakDetector.java +++ b/common/src/main/java/io/netty/util/ResourceLeakDetector.java @@ -369,7 +369,8 @@ public class ResourceLeakDetector { // be collected via the WeakReference. trackedHash = System.identityHashCode(referent); allLeaks.put(this, LeakEntry.INSTANCE); - headUpdater.set(this, Record.BOTTOM); + // Create a new Record so we always have the creation stacktrace included. + headUpdater.set(this, new Record(Record.BOTTOM)); this.allLeaks = allLeaks; }