6539517: CR 6186200 should be extended to perm gen allocation to prevent spurious OOM's from perm gen

Reviewed-by: ysr, jmasa
This commit is contained in:
Andrey Petrusenko 2008-04-01 15:13:47 +04:00
parent 6bfbc36dcd
commit 252a10cf1a
14 changed files with 165 additions and 80 deletions

View file

@ -32,6 +32,12 @@ volatile bool GC_locker::_doing_gc = false;
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()) {