< prev index next >

src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp

Print this page


   1 /*
   2  * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


3991     }
3992 
3993     _gc_tracer_stw->report_yc_type(yc_type());
3994 
3995     TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
3996 
3997     uint active_workers = AdaptiveSizePolicy::calc_active_workers(workers()->total_workers(),
3998                                                                   workers()->active_workers(),
3999                                                                   Threads::number_of_non_daemon_threads());
4000     assert(UseDynamicNumberOfGCThreads ||
4001            active_workers == workers()->total_workers(),
4002            "If not dynamic should be using all the  workers");
4003     workers()->set_active_workers(active_workers);
4004 
4005 
4006     double pause_start_sec = os::elapsedTime();
4007     g1_policy()->phase_times()->note_gc_start(active_workers, mark_in_progress());
4008     log_gc_header();
4009 
4010     TraceCollectorStats tcs(g1mm()->incremental_collection_counters());
4011     TraceMemoryManagerStats tms(false /* fullGC */, gc_cause());

4012 
4013     // If the secondary_free_list is not empty, append it to the
4014     // free_list. No need to wait for the cleanup operation to finish;
4015     // the region allocation code will check the secondary_free_list
4016     // and wait if necessary. If the G1StressConcRegionFreeing flag is
4017     // set, skip this step so that the region allocation code has to
4018     // get entries from the secondary_free_list.
4019     if (!G1StressConcRegionFreeing) {
4020       append_secondary_free_list_if_not_empty_with_lock();
4021     }
4022 
4023     assert(check_young_list_well_formed(), "young list should be well formed");
4024     assert(check_heap_region_claim_values(HeapRegion::InitialClaimValue),
4025            "sanity check");
4026 
4027     // Don't dynamically change the number of GC threads this early.  A value of
4028     // 0 is used to indicate serial work.  When parallel work is done,
4029     // it will be set.
4030 
4031     { // Call to jvmpi::post_class_unload_events must occur outside of active GC


   1 /*
   2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


3991     }
3992 
3993     _gc_tracer_stw->report_yc_type(yc_type());
3994 
3995     TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
3996 
3997     uint active_workers = AdaptiveSizePolicy::calc_active_workers(workers()->total_workers(),
3998                                                                   workers()->active_workers(),
3999                                                                   Threads::number_of_non_daemon_threads());
4000     assert(UseDynamicNumberOfGCThreads ||
4001            active_workers == workers()->total_workers(),
4002            "If not dynamic should be using all the  workers");
4003     workers()->set_active_workers(active_workers);
4004 
4005 
4006     double pause_start_sec = os::elapsedTime();
4007     g1_policy()->phase_times()->note_gc_start(active_workers, mark_in_progress());
4008     log_gc_header();
4009 
4010     TraceCollectorStats tcs(g1mm()->incremental_collection_counters());
4011     TraceMemoryManagerStats tms(false /* fullGC */, gc_cause(),
4012                                 yc_type() == Mixed /* allMemoryPoolsAffected */);
4013 
4014     // If the secondary_free_list is not empty, append it to the
4015     // free_list. No need to wait for the cleanup operation to finish;
4016     // the region allocation code will check the secondary_free_list
4017     // and wait if necessary. If the G1StressConcRegionFreeing flag is
4018     // set, skip this step so that the region allocation code has to
4019     // get entries from the secondary_free_list.
4020     if (!G1StressConcRegionFreeing) {
4021       append_secondary_free_list_if_not_empty_with_lock();
4022     }
4023 
4024     assert(check_young_list_well_formed(), "young list should be well formed");
4025     assert(check_heap_region_claim_values(HeapRegion::InitialClaimValue),
4026            "sanity check");
4027 
4028     // Don't dynamically change the number of GC threads this early.  A value of
4029     // 0 is used to indicate serial work.  When parallel work is done,
4030     // it will be set.
4031 
4032     { // Call to jvmpi::post_class_unload_events must occur outside of active GC


< prev index next >