mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
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:
parent
46dcdf10e6
commit
9d9317de4c
5 changed files with 39 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue