--- a/hotspot/src/share/vm/memory/collectorPolicy.cpp Fri Dec 21 10:27:49 2012 -0800
+++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp Mon Dec 03 15:09:39 2012 -0800
@@ -777,6 +777,15 @@
full_gc_count,
GCCause::_metadata_GC_threshold);
VMThread::execute(&op);
+
+ // If GC was locked out, try again. Check
+ // before checking success because the prologue
+ // could have succeeded and the GC still have
+ // been locked out.
+ if (op.gc_locked()) {
+ continue;
+ }
+
if (op.prologue_succeeded()) {
return op.result();
}