diff --git a/src/share/vm/memory/collectorPolicy.cpp b/src/share/vm/memory/collectorPolicy.cpp index 4d42723020677539d1976fae53210a14e0e32e64..6c0b1bd82c4c3d693cb6d38d3f1c16e56990c721 100644 --- a/src/share/vm/memory/collectorPolicy.cpp +++ b/src/share/vm/memory/collectorPolicy.cpp @@ -742,6 +742,8 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation( uint gc_count = 0; uint full_gc_count = 0; + assert(!Heap_lock->owned_by_self(), "Should not be holding the Heap_lock"); + do { MetaWord* result = NULL; if (GC_locker::is_active_and_needs_gc()) { @@ -756,7 +758,6 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation( } JavaThread* jthr = JavaThread::current(); if (!jthr->in_critical()) { - MutexUnlocker mul(Heap_lock); // Wait for JNI critical section to be exited GC_locker::stall_until_clear(); // The GC invoked by the last thread leaving the critical