src/share/vm/memory/tenuredGeneration.hpp

Tue, 11 Sep 2012 14:59:23 +0200

author
stefank
date
Tue, 11 Sep 2012 14:59:23 +0200
changeset 4050
ec98e58952b2
parent 2314
f95d63e2154a
child 4542
db9981fd3124
permissions
-rw-r--r--

7197350: NPG: jvmtiHeapReferenceCallback receives incorrect reference_kind for system class roots
Summary: Fix the iteration over the system classes and report the correct reference kind.
Reviewed-by: coleenp, rbackman

duke@435 1 /*
stefank@2314 2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
stefank@2314 25 #ifndef SHARE_VM_MEMORY_TENUREDGENERATION_HPP
stefank@2314 26 #define SHARE_VM_MEMORY_TENUREDGENERATION_HPP
stefank@2314 27
stefank@2314 28 #include "gc_implementation/shared/cSpaceCounters.hpp"
stefank@2314 29 #include "gc_implementation/shared/gcStats.hpp"
stefank@2314 30 #include "gc_implementation/shared/generationCounters.hpp"
stefank@2314 31 #include "memory/generation.hpp"
stefank@2314 32
duke@435 33 // TenuredGeneration models the heap containing old (promoted/tenured) objects.
duke@435 34
duke@435 35 class ParGCAllocBufferWithBOT;
duke@435 36
duke@435 37 class TenuredGeneration: public OneContigSpaceCardGeneration {
duke@435 38 friend class VMStructs;
duke@435 39 protected:
duke@435 40 // current shrinking effect: this damps shrinking when the heap gets empty.
duke@435 41 size_t _shrink_factor;
duke@435 42 // Some statistics from before gc started.
duke@435 43 // These are gathered in the gc_prologue (and should_collect)
duke@435 44 // to control growing/shrinking policy in spite of promotions.
duke@435 45 size_t _capacity_at_prologue;
duke@435 46 size_t _used_at_prologue;
duke@435 47
duke@435 48 #ifndef SERIALGC
duke@435 49 // To support parallel promotion: an array of parallel allocation
duke@435 50 // buffers, one per thread, initially NULL.
duke@435 51 ParGCAllocBufferWithBOT** _alloc_buffers;
duke@435 52 #endif // SERIALGC
duke@435 53
duke@435 54 // Retire all alloc buffers before a full GC, so that they will be
duke@435 55 // re-allocated at the start of the next young GC.
duke@435 56 void retire_alloc_buffers_before_full_gc();
duke@435 57
duke@435 58 GenerationCounters* _gen_counters;
duke@435 59 CSpaceCounters* _space_counters;
duke@435 60
duke@435 61 public:
duke@435 62 TenuredGeneration(ReservedSpace rs, size_t initial_byte_size, int level,
duke@435 63 GenRemSet* remset);
duke@435 64
duke@435 65 Generation::Name kind() { return Generation::MarkSweepCompact; }
duke@435 66
duke@435 67 // Printing
duke@435 68 const char* name() const;
duke@435 69 const char* short_name() const { return "Tenured"; }
duke@435 70 bool must_be_youngest() const { return false; }
duke@435 71 bool must_be_oldest() const { return true; }
duke@435 72
duke@435 73 // Does a "full" (forced) collection invoked on this generation collect
duke@435 74 // all younger generations as well? Note that this is a
duke@435 75 // hack to allow the collection of the younger gen first if the flag is
duke@435 76 // set. This is better than using th policy's should_collect_gen0_first()
duke@435 77 // since that causes us to do an extra unnecessary pair of restart-&-stop-world.
duke@435 78 virtual bool full_collects_younger_generations() const {
duke@435 79 return !CollectGen0First;
duke@435 80 }
duke@435 81
duke@435 82 // Mark sweep support
duke@435 83 void compute_new_size();
duke@435 84
duke@435 85 virtual void gc_prologue(bool full);
duke@435 86 virtual void gc_epilogue(bool full);
duke@435 87 bool should_collect(bool full,
duke@435 88 size_t word_size,
duke@435 89 bool is_tlab);
duke@435 90
duke@435 91 virtual void collect(bool full,
duke@435 92 bool clear_all_soft_refs,
duke@435 93 size_t size,
duke@435 94 bool is_tlab);
duke@435 95
duke@435 96 #ifndef SERIALGC
duke@435 97 // Overrides.
duke@435 98 virtual oop par_promote(int thread_num,
duke@435 99 oop obj, markOop m, size_t word_sz);
duke@435 100 virtual void par_promote_alloc_undo(int thread_num,
duke@435 101 HeapWord* obj, size_t word_sz);
duke@435 102 virtual void par_promote_alloc_done(int thread_num);
duke@435 103 #endif // SERIALGC
duke@435 104
duke@435 105 // Performance Counter support
duke@435 106 void update_counters();
duke@435 107
duke@435 108 // Statistics
duke@435 109
duke@435 110 virtual void update_gc_stats(int level, bool full);
duke@435 111
ysr@2243 112 virtual bool promotion_attempt_is_safe(size_t max_promoted_in_bytes) const;
duke@435 113
duke@435 114 void verify_alloc_buffers_clean();
duke@435 115 };
stefank@2314 116
stefank@2314 117 #endif // SHARE_VM_MEMORY_TENUREDGENERATION_HPP

mercurial