hotspot/src/share/vm/memory/gcLocker.cpp
changeset 386 7f121b1192f2
parent 1 489c9b5090e2
child 670 ddf3e9583f2f
--- a/hotspot/src/share/vm/memory/gcLocker.cpp	Thu Mar 27 17:22:06 2008 -0700
+++ b/hotspot/src/share/vm/memory/gcLocker.cpp	Tue Apr 01 15:13:47 2008 +0400
@@ -32,6 +32,12 @@
 
 void GC_locker::stall_until_clear() {
   assert(!JavaThread::current()->in_critical(), "Would deadlock");
+  if (PrintJNIGCStalls && PrintGCDetails) {
+    ResourceMark rm; // JavaThread::name() allocates to convert to UTF8
+    gclog_or_tty->print_cr(
+      "Allocation failed. Thread \"%s\" is stalled by JNI critical section.",
+      JavaThread::current()->name());
+  }
   MutexLocker   ml(JNICritical_lock);
   // Wait for _needs_gc  to be cleared
   while (GC_locker::needs_gc()) {