diff options
author | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-07-20 13:39:12 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-07-20 13:39:12 +0200 |
commit | b5cf9d54eeb58a0464c72d78cba2a2e6f78dc244 (patch) | |
tree | 8f4bb71291e49f27b95c1a48b02634788fa4b51c /jdisc_core | |
parent | 929a44e999bbaae9600753aea1a8335a9facd69e (diff) |
Triggering finalization does not guarantee that phantom references are enqueued
Diffstat (limited to 'jdisc_core')
-rw-r--r-- | jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdog.java | 1 | ||||
-rw-r--r-- | jdisc_core/src/test/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdogTest.java | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdog.java b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdog.java index 588e5293066..69f33c833e1 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdog.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdog.java @@ -126,7 +126,6 @@ class ActiveContainerDeactivationWatchdog implements ActiveContainerMetrics, Aut private static void triggerGc() { log.log(Level.FINE, "Triggering GC"); System.gc(); - System.runFinalization(); // this is required to trigger enqueuing of phantom references on some Linux systems } private void enforceDestructionOfGarbageCollectedContainers() { diff --git a/jdisc_core/src/test/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdogTest.java b/jdisc_core/src/test/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdogTest.java index dfb0272f5ea..a8bf7bd1d62 100644 --- a/jdisc_core/src/test/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdogTest.java +++ b/jdisc_core/src/test/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdogTest.java @@ -69,7 +69,8 @@ public class ActiveContainerDeactivationWatchdogTest { } @Test - @Ignore + @Ignore("Ignored as it assumes phantom references are enqueued right after first GC have cleared the weak reference. " + + "This is the case on most JVMs.") public void deactivated_container_destructed_if_its_reference_counter_is_nonzero() { ExecutorMock executor = new ExecutorMock(); ActiveContainerDeactivationWatchdog watchdog = |