author | jprovino |
Wed, 06 Mar 2013 13:38:17 -0500 | |
changeset 15936 | 4fda1079e8a3 |
parent 15482 | 470d0b0c09f1 |
child 16681 | d64161ca3e3c |
permissions | -rw-r--r-- |
1 | 1 |
/* |
7397 | 2 |
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1623
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1623
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1623
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 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" |
|
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
7397
diff
changeset
|
32 |
#include "utilities/macros.hpp" |
7397 | 33 |
|
1 | 34 |
// TenuredGeneration models the heap containing old (promoted/tenured) objects. |
35 |
||
36 |
class ParGCAllocBufferWithBOT; |
|
37 |
||
38 |
class TenuredGeneration: public OneContigSpaceCardGeneration { |
|
39 |
friend class VMStructs; |
|
40 |
protected: |
|
41 |
// current shrinking effect: this damps shrinking when the heap gets empty. |
|
42 |
size_t _shrink_factor; |
|
43 |
// Some statistics from before gc started. |
|
44 |
// These are gathered in the gc_prologue (and should_collect) |
|
45 |
// to control growing/shrinking policy in spite of promotions. |
|
46 |
size_t _capacity_at_prologue; |
|
47 |
size_t _used_at_prologue; |
|
48 |
||
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
7397
diff
changeset
|
49 |
#if INCLUDE_ALL_GCS |
1 | 50 |
// To support parallel promotion: an array of parallel allocation |
51 |
// buffers, one per thread, initially NULL. |
|
52 |
ParGCAllocBufferWithBOT** _alloc_buffers; |
|
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
7397
diff
changeset
|
53 |
#endif // INCLUDE_ALL_GCS |
1 | 54 |
|
55 |
// Retire all alloc buffers before a full GC, so that they will be |
|
56 |
// re-allocated at the start of the next young GC. |
|
57 |
void retire_alloc_buffers_before_full_gc(); |
|
58 |
||
59 |
GenerationCounters* _gen_counters; |
|
60 |
CSpaceCounters* _space_counters; |
|
61 |
||
62 |
public: |
|
63 |
TenuredGeneration(ReservedSpace rs, size_t initial_byte_size, int level, |
|
64 |
GenRemSet* remset); |
|
65 |
||
66 |
Generation::Name kind() { return Generation::MarkSweepCompact; } |
|
67 |
||
68 |
// Printing |
|
69 |
const char* name() const; |
|
70 |
const char* short_name() const { return "Tenured"; } |
|
71 |
bool must_be_youngest() const { return false; } |
|
72 |
bool must_be_oldest() const { return true; } |
|
73 |
||
74 |
// Does a "full" (forced) collection invoked on this generation collect |
|
75 |
// all younger generations as well? Note that this is a |
|
76 |
// hack to allow the collection of the younger gen first if the flag is |
|
77 |
// set. This is better than using th policy's should_collect_gen0_first() |
|
78 |
// since that causes us to do an extra unnecessary pair of restart-&-stop-world. |
|
79 |
virtual bool full_collects_younger_generations() const { |
|
80 |
return !CollectGen0First; |
|
81 |
} |
|
82 |
||
83 |
// Mark sweep support |
|
84 |
void compute_new_size(); |
|
85 |
||
86 |
virtual void gc_prologue(bool full); |
|
87 |
virtual void gc_epilogue(bool full); |
|
88 |
bool should_collect(bool full, |
|
89 |
size_t word_size, |
|
90 |
bool is_tlab); |
|
91 |
||
92 |
virtual void collect(bool full, |
|
93 |
bool clear_all_soft_refs, |
|
94 |
size_t size, |
|
95 |
bool is_tlab); |
|
96 |
||
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
7397
diff
changeset
|
97 |
#if INCLUDE_ALL_GCS |
1 | 98 |
// Overrides. |
99 |
virtual oop par_promote(int thread_num, |
|
100 |
oop obj, markOop m, size_t word_sz); |
|
101 |
virtual void par_promote_alloc_undo(int thread_num, |
|
102 |
HeapWord* obj, size_t word_sz); |
|
103 |
virtual void par_promote_alloc_done(int thread_num); |
|
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
7397
diff
changeset
|
104 |
#endif // INCLUDE_ALL_GCS |
1 | 105 |
|
106 |
// Performance Counter support |
|
107 |
void update_counters(); |
|
108 |
||
109 |
// Statistics |
|
110 |
||
111 |
virtual void update_gc_stats(int level, bool full); |
|
112 |
||
6985
e9364ec299ac
6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data
ysr
parents:
5547
diff
changeset
|
113 |
virtual bool promotion_attempt_is_safe(size_t max_promoted_in_bytes) const; |
1 | 114 |
|
115 |
void verify_alloc_buffers_clean(); |
|
116 |
}; |
|
7397 | 117 |
|
118 |
#endif // SHARE_VM_MEMORY_TENUREDGENERATION_HPP |