Mercurial > hg > graal-compiler
comparison src/share/vm/memory/gcLocker.cpp @ 139:c0492d52d55b
6539517: CR 6186200 should be extended to perm gen allocation to prevent spurious OOM's from perm gen
Reviewed-by: ysr, jmasa
author | apetrusenko |
---|---|
date | Tue, 01 Apr 2008 15:13:47 +0400 |
parents | a61af66fc99e |
children | d1605aabd0a1 |
comparison
equal
deleted
inserted
replaced
95:d05ebaf00ed0 | 139:c0492d52d55b |
---|---|
30 volatile bool GC_locker::_needs_gc = false; | 30 volatile bool GC_locker::_needs_gc = false; |
31 volatile bool GC_locker::_doing_gc = false; | 31 volatile bool GC_locker::_doing_gc = false; |
32 | 32 |
33 void GC_locker::stall_until_clear() { | 33 void GC_locker::stall_until_clear() { |
34 assert(!JavaThread::current()->in_critical(), "Would deadlock"); | 34 assert(!JavaThread::current()->in_critical(), "Would deadlock"); |
35 if (PrintJNIGCStalls && PrintGCDetails) { | |
36 ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 | |
37 gclog_or_tty->print_cr( | |
38 "Allocation failed. Thread \"%s\" is stalled by JNI critical section.", | |
39 JavaThread::current()->name()); | |
40 } | |
35 MutexLocker ml(JNICritical_lock); | 41 MutexLocker ml(JNICritical_lock); |
36 // Wait for _needs_gc to be cleared | 42 // Wait for _needs_gc to be cleared |
37 while (GC_locker::needs_gc()) { | 43 while (GC_locker::needs_gc()) { |
38 JNICritical_lock->wait(); | 44 JNICritical_lock->wait(); |
39 } | 45 } |