Request for review: 6976528 (vs) - PS: assert(!limit_exceeded || softrefs_clear) failed: Should have been cleared

Jon Masamitsu jon.masamitsu at oracle.com
Mon Mar 4 22:49:36 UTC 2013


The assertion was intended to verify that soft references would
always be cleared before an out-of-memory is thrown.  There
is actually code that guarantees that (the soft references
have been cleared before an out-of-memory is thrown) and
this assertion is superfluous.

6976528: PS: assert(!limit_exceeded || softrefs_clear) failed: Should 
have been cleared

http://cr.openjdk.java.net/~jmasa/6976528/webrev.00/

The assertion failed in some circumstance and after looking at
the code paths I decided there were too many paths for it to be
obvious that the assertion should hold so I deleted the assertion.

Thanks.

Jon

If you prefer the diffs here they are (2 deleted lines).

diff --git a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp

--- a/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp

+++ b/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp

@@ -409,7 +409,7 @@

          // heap remains parsable.

          const bool limit_exceeded = size_policy()->gc_overhead_limit_exceeded();

          const bool softrefs_clear = collector_policy()->all_soft_refs_clear();

-        assert(!limit_exceeded || softrefs_clear, "Should have been cleared");

+

          if (limit_exceeded&&  softrefs_clear) {

            *gc_overhead_limit_was_exceeded = true;

            size_policy()->set_gc_overhead_limit_exceeded(false);

diff --git a/src/share/vm/memory/collectorPolicy.cpp b/src/share/vm/memory/collectorPolicy.cpp

--- a/src/share/vm/memory/collectorPolicy.cpp

+++ b/src/share/vm/memory/collectorPolicy.cpp

@@ -620,7 +620,7 @@

        const bool limit_exceeded = size_policy()->gc_overhead_limit_exceeded();

        const bool softrefs_clear = all_soft_refs_clear();

-      assert(!limit_exceeded || softrefs_clear, "Should have been cleared");

+

        if (limit_exceeded&&  softrefs_clear) {

          *gc_overhead_limit_was_exceeded = true;

          size_policy()->set_gc_overhead_limit_exceeded(false);





More information about the hotspot-gc-dev mailing list