Mercurial > hg > graal-jvmci-8
annotate src/share/vm/memory/tenuredGeneration.hpp @ 3772:6747fd0512e0
7004681: G1: Extend marking verification to Full GCs
Summary: Perform a heap verification after the first phase of G1's full GC using objects' mark words to determine liveness. The third parameter of the heap verification routines, which was used in G1 to determine which marking bitmap to use in liveness calculations, has been changed from a boolean to an enum with values defined for using the mark word, and the 'prev' and 'next' bitmaps.
Reviewed-by: tonyp, ysr
author | johnc |
---|---|
date | Tue, 14 Jun 2011 11:01:10 -0700 |
parents | f95d63e2154a |
children | db9981fd3124 |
rev | line source |
---|---|
0 | 1 /* |
1972 | 2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
470
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
470
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
470
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_MEMORY_TENUREDGENERATION_HPP |
26 #define SHARE_VM_MEMORY_TENUREDGENERATION_HPP | |
27 | |
28 #include "gc_implementation/shared/cSpaceCounters.hpp" | |
29 #include "gc_implementation/shared/gcStats.hpp" | |
30 #include "gc_implementation/shared/generationCounters.hpp" | |
31 #include "memory/generation.hpp" | |
32 | |
0 | 33 // TenuredGeneration models the heap containing old (promoted/tenured) objects. |
34 | |
35 class ParGCAllocBufferWithBOT; | |
36 | |
37 class TenuredGeneration: public OneContigSpaceCardGeneration { | |
38 friend class VMStructs; | |
39 protected: | |
40 // current shrinking effect: this damps shrinking when the heap gets empty. | |
41 size_t _shrink_factor; | |
42 // Some statistics from before gc started. | |
43 // These are gathered in the gc_prologue (and should_collect) | |
44 // to control growing/shrinking policy in spite of promotions. | |
45 size_t _capacity_at_prologue; | |
46 size_t _used_at_prologue; | |
47 | |
48 #ifndef SERIALGC | |
49 // To support parallel promotion: an array of parallel allocation | |
50 // buffers, one per thread, initially NULL. | |
51 ParGCAllocBufferWithBOT** _alloc_buffers; | |
52 #endif // SERIALGC | |
53 | |
54 // Retire all alloc buffers before a full GC, so that they will be | |
55 // re-allocated at the start of the next young GC. | |
56 void retire_alloc_buffers_before_full_gc(); | |
57 | |
58 GenerationCounters* _gen_counters; | |
59 CSpaceCounters* _space_counters; | |
60 | |
61 public: | |
62 TenuredGeneration(ReservedSpace rs, size_t initial_byte_size, int level, | |
63 GenRemSet* remset); | |
64 | |
65 Generation::Name kind() { return Generation::MarkSweepCompact; } | |
66 | |
67 // Printing | |
68 const char* name() const; | |
69 const char* short_name() const { return "Tenured"; } | |
70 bool must_be_youngest() const { return false; } | |
71 bool must_be_oldest() const { return true; } | |
72 | |
73 // Does a "full" (forced) collection invoked on this generation collect | |
74 // all younger generations as well? Note that this is a | |
75 // hack to allow the collection of the younger gen first if the flag is | |
76 // set. This is better than using th policy's should_collect_gen0_first() | |
77 // since that causes us to do an extra unnecessary pair of restart-&-stop-world. | |
78 virtual bool full_collects_younger_generations() const { | |
79 return !CollectGen0First; | |
80 } | |
81 | |
82 // Mark sweep support | |
83 void compute_new_size(); | |
84 | |
85 virtual void gc_prologue(bool full); | |
86 virtual void gc_epilogue(bool full); | |
87 bool should_collect(bool full, | |
88 size_t word_size, | |
89 bool is_tlab); | |
90 | |
91 virtual void collect(bool full, | |
92 bool clear_all_soft_refs, | |
93 size_t size, | |
94 bool is_tlab); | |
95 | |
96 #ifndef SERIALGC | |
97 // Overrides. | |
98 virtual oop par_promote(int thread_num, | |
99 oop obj, markOop m, size_t word_sz); | |
100 virtual void par_promote_alloc_undo(int thread_num, | |
101 HeapWord* obj, size_t word_sz); | |
102 virtual void par_promote_alloc_done(int thread_num); | |
103 #endif // SERIALGC | |
104 | |
105 // Performance Counter support | |
106 void update_counters(); | |
107 | |
108 // Statistics | |
109 | |
110 virtual void update_gc_stats(int level, bool full); | |
111 | |
1888
a7214d79fcf1
6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data
ysr
parents:
1552
diff
changeset
|
112 virtual bool promotion_attempt_is_safe(size_t max_promoted_in_bytes) const; |
0 | 113 |
114 void verify_alloc_buffers_clean(); | |
115 }; | |
1972 | 116 |
117 #endif // SHARE_VM_MEMORY_TENUREDGENERATION_HPP |