src/share/vm/gc_implementation/shared/vmGCOperations.cpp

changeset 6994
bac98749fe00
parent 6992
2c6ef90f030a
child 6996
f3aeae1f9fc5
     1.1 --- a/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Wed Jul 09 16:44:30 2014 +0200
     1.2 +++ b/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Fri Jul 11 09:07:23 2014 +0200
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -211,28 +211,29 @@
    1.11  
    1.12  bool VM_CollectForMetadataAllocation::initiate_concurrent_GC() {
    1.13  #if INCLUDE_ALL_GCS
    1.14 -  if (UseConcMarkSweepGC || UseG1GC) {
    1.15 -    if (UseConcMarkSweepGC && CMSClassUnloadingEnabled) {
    1.16 -      MetaspaceGC::set_should_concurrent_collect(true);
    1.17 -    } else if (UseG1GC) {
    1.18 -      G1CollectedHeap* g1h = G1CollectedHeap::heap();
    1.19 -      g1h->g1_policy()->set_initiate_conc_mark_if_possible();
    1.20 +  if (UseConcMarkSweepGC && CMSClassUnloadingEnabled) {
    1.21 +    MetaspaceGC::set_should_concurrent_collect(true);
    1.22 +    return true;
    1.23 +  }
    1.24  
    1.25 -      GCCauseSetter x(g1h, _gc_cause);
    1.26 +  if (UseG1GC) {
    1.27 +    G1CollectedHeap* g1h = G1CollectedHeap::heap();
    1.28 +    g1h->g1_policy()->set_initiate_conc_mark_if_possible();
    1.29  
    1.30 -      // At this point we are supposed to start a concurrent cycle. We
    1.31 -      // will do so if one is not already in progress.
    1.32 -      bool should_start = g1h->g1_policy()->force_initial_mark_if_outside_cycle(_gc_cause);
    1.33 +    GCCauseSetter x(g1h, _gc_cause);
    1.34  
    1.35 -      if (should_start) {
    1.36 -        double pause_target = g1h->g1_policy()->max_pause_time_ms();
    1.37 -        g1h->do_collection_pause_at_safepoint(pause_target);
    1.38 -      }
    1.39 +    // At this point we are supposed to start a concurrent cycle. We
    1.40 +    // will do so if one is not already in progress.
    1.41 +    bool should_start = g1h->g1_policy()->force_initial_mark_if_outside_cycle(_gc_cause);
    1.42 +
    1.43 +    if (should_start) {
    1.44 +      double pause_target = g1h->g1_policy()->max_pause_time_ms();
    1.45 +      g1h->do_collection_pause_at_safepoint(pause_target);
    1.46      }
    1.47 -
    1.48      return true;
    1.49    }
    1.50  #endif
    1.51 +
    1.52    return false;
    1.53  }
    1.54  

mercurial