diff options
author | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-06-07 10:56:34 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-06-08 12:39:11 +0200 |
commit | 025eae59e89a473dbff75b435df3dc4710b8a789 (patch) | |
tree | f81b02caeff9b2083fb618c249e68487301f05c9 /jdisc_core | |
parent | ab131f2a48628dd7ed86e112819860c67e8df75b (diff) |
Improve error message when ActiveContainer is destructed through finalizer
Diffstat (limited to 'jdisc_core')
-rw-r--r-- | jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainer.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainer.java b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainer.java index 692c669780f..51a84a4a6c6 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainer.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainer.java @@ -67,12 +67,13 @@ public class ActiveContainer extends AbstractResource implements CurrentContaine termination.run(); } + // TODO Get rid of finalizer and use PhantomReference or Java 9 Cleaner instead @Override protected void finalize() throws Throwable { try { int retainCount = retainCount(); if (retainCount > 0) { - log.warning(this + ".destroy() invoked from finalize() not through ApplicationLoader. " + + log.severe("Destructing " + this + " through finalizer since reference count never reached zero. " + "This is an indication of either a resource leak or invalid use of reference counting. " + "Retained references as this moment: " + retainCount); destroy(); |