6820167: GCALotAtAllSafepoints + FullGCALot(ScavengeALot) options crash JVM

Short-circuit gc-a-lot attempts by non-JavaThreads; SkipGCALot c'tor to elide re-entrant gc-a-lot attempts.

Reviewed-by: apetrusenko, jcoomes, jmasa, kamg
This commit is contained in:
Y. Srinivas Ramakrishna 2009-06-11 12:40:00 -07:00
parent 46dcdf10e6
commit 9d9317de4c
5 changed files with 39 additions and 2 deletions

View file

@ -66,11 +66,14 @@ void InterfaceSupport::trace(const char* result_type, const char* header) {
void InterfaceSupport::gc_alot() {
Thread *thread = Thread::current();
if (thread->is_VM_thread()) return; // Avoid concurrent calls
if (!thread->is_Java_thread()) return; // Avoid concurrent calls
// Check for new, not quite initialized thread. A thread in new mode cannot initiate a GC.
JavaThread *current_thread = (JavaThread *)thread;
if (current_thread->active_handles() == NULL) return;
// Short-circuit any possible re-entrant gc-a-lot attempt
if (thread->skip_gcalot()) return;
if (is_init_completed()) {
if (++_fullgc_alot_invocation < FullGCALotStart) {