annotate src/share/vm/gc_implementation/g1/concurrentZFThread.hpp @ 936:e1fdf4fd34dc

6871111: G1: remove the concurrent overhead tracker Summary: Removing the concurrent overhead tracker from G1, along with the GC overhead reporter and the G1AccountConcurrentOverhead (both of which rely on the the concurrent overhead tracker). Reviewed-by: iveresov, johnc
author tonyp
date Wed, 19 Aug 2009 12:53:25 -0400
parents bd02caa94611
children 035d2e036a9b
rev   line source
ysr@342 1 /*
xdono@844 2 * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved.
ysr@342 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ysr@342 4 *
ysr@342 5 * This code is free software; you can redistribute it and/or modify it
ysr@342 6 * under the terms of the GNU General Public License version 2 only, as
ysr@342 7 * published by the Free Software Foundation.
ysr@342 8 *
ysr@342 9 * This code is distributed in the hope that it will be useful, but WITHOUT
ysr@342 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ysr@342 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ysr@342 12 * version 2 for more details (a copy is included in the LICENSE file that
ysr@342 13 * accompanied this code).
ysr@342 14 *
ysr@342 15 * You should have received a copy of the GNU General Public License version
ysr@342 16 * 2 along with this work; if not, write to the Free Software Foundation,
ysr@342 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ysr@342 18 *
ysr@342 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
ysr@342 20 * CA 95054 USA or visit www.sun.com if you need additional information or
ysr@342 21 * have any questions.
ysr@342 22 *
ysr@342 23 */
ysr@342 24
ysr@342 25 // The Concurrent ZF Thread. Performs concurrent zero-filling.
ysr@342 26
ysr@342 27 class ConcurrentZFThread: public ConcurrentGCThread {
ysr@342 28 friend class VMStructs;
ysr@342 29 friend class ZeroFillRegionClosure;
ysr@342 30
ysr@342 31 private:
ysr@342 32
ysr@342 33 // Zero fill the heap region.
ysr@342 34 void processHeapRegion(HeapRegion* r);
ysr@342 35
ysr@342 36 // Stats
ysr@342 37 // Allocation (protected by heap lock).
ysr@342 38 static int _region_allocs; // Number of regions allocated
ysr@342 39 static int _sync_zfs; // Synchronous zero-fills +
ysr@342 40 static int _zf_waits; // Wait for conc zero-fill completion.
ysr@342 41
ysr@342 42 // Number of regions CFZ thread fills.
ysr@342 43 static int _regions_filled;
ysr@342 44
ysr@342 45 double _vtime_start; // Initial virtual time.
ysr@342 46
ysr@342 47 // These are static because the "print_summary_info" method is, and
ysr@342 48 // it currently assumes there is only one ZF thread. We'll change when
ysr@342 49 // we need to.
ysr@342 50 static double _vtime_accum; // Initial virtual time.
ysr@342 51 static double vtime_accum() { return _vtime_accum; }
ysr@342 52
ysr@342 53 // Offer yield for GC. Returns true if yield occurred.
ysr@342 54 bool offer_yield();
ysr@342 55
ysr@342 56 public:
ysr@342 57 // Constructor
ysr@342 58 ConcurrentZFThread();
ysr@342 59
ysr@342 60 // Main loop.
ysr@342 61 virtual void run();
ysr@342 62
ysr@342 63 // Printing
ysr@342 64 void print();
ysr@342 65
ysr@342 66 // Waits until "r" has been zero-filled. Requires caller to hold the
ysr@342 67 // ZF_mon.
ysr@342 68 static void wait_for_ZF_completed(HeapRegion* r);
ysr@342 69
ysr@342 70 // Get or clear the current unclean region. Should be done
ysr@342 71 // while holding the ZF_needed_mon lock.
ysr@342 72
ysr@342 73 // shutdown
iveresov@794 74 void stop();
ysr@342 75
ysr@342 76 // Stats
ysr@342 77 static void note_region_alloc() {_region_allocs++; }
ysr@342 78 static void note_sync_zfs() { _sync_zfs++; }
ysr@342 79 static void note_zf_wait() { _zf_waits++; }
ysr@342 80 static void note_region_filled() { _regions_filled++; }
ysr@342 81
ysr@342 82 static void print_summary_info();
ysr@342 83 };