Mercurial > hg > truffle
annotate src/share/vm/gc_implementation/shared/gcHeapSummary.hpp @ 20256:b0b97602393a
8033923: Use BufferingOopClosure for G1 code root scanning
Reviewed-by: mgerdin, brutisso
author | stefank |
---|---|
date | Mon, 10 Feb 2014 12:58:09 +0100 |
parents | fa21c9537e6e |
children |
rev | line source |
---|---|
10405 | 1 /* |
2 * Copyright (c) 2012, 2013, 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 * | |
23 */ | |
24 | |
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCHEAPSUMMARY_HPP | |
26 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCHEAPSUMMARY_HPP | |
27 | |
28 #include "memory/allocation.hpp" | |
17771
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
29 #include "memory/metaspaceChunkFreeListSummary.hpp" |
10405 | 30 |
31 class VirtualSpaceSummary : public StackObj { | |
32 HeapWord* _start; | |
33 HeapWord* _committed_end; | |
34 HeapWord* _reserved_end; | |
35 public: | |
36 VirtualSpaceSummary() : | |
37 _start(NULL), _committed_end(NULL), _reserved_end(NULL) { } | |
38 VirtualSpaceSummary(HeapWord* start, HeapWord* committed_end, HeapWord* reserved_end) : | |
39 _start(start), _committed_end(committed_end), _reserved_end(reserved_end) { } | |
40 | |
41 HeapWord* start() const { return _start; } | |
42 HeapWord* committed_end() const { return _committed_end; } | |
43 HeapWord* reserved_end() const { return _reserved_end; } | |
44 size_t committed_size() const { return (uintptr_t)_committed_end - (uintptr_t)_start; } | |
45 size_t reserved_size() const { return (uintptr_t)_reserved_end - (uintptr_t)_start; } | |
46 }; | |
47 | |
48 class SpaceSummary : public StackObj { | |
49 HeapWord* _start; | |
50 HeapWord* _end; | |
51 size_t _used; | |
52 public: | |
53 SpaceSummary() : | |
54 _start(NULL), _end(NULL), _used(0) { } | |
55 SpaceSummary(HeapWord* start, HeapWord* end, size_t used) : | |
56 _start(start), _end(end), _used(used) { } | |
57 | |
58 HeapWord* start() const { return _start; } | |
59 HeapWord* end() const { return _end; } | |
60 size_t used() const { return _used; } | |
61 size_t size() const { return (uintptr_t)_end - (uintptr_t)_start; } | |
62 }; | |
63 | |
64 class MetaspaceSizes : public StackObj { | |
17865
fa21c9537e6e
8035667: EventMetaspaceSummary doesn't report committed Metaspace memory
ehelin
parents:
17771
diff
changeset
|
65 size_t _committed; |
10405 | 66 size_t _used; |
67 size_t _reserved; | |
68 | |
69 public: | |
17865
fa21c9537e6e
8035667: EventMetaspaceSummary doesn't report committed Metaspace memory
ehelin
parents:
17771
diff
changeset
|
70 MetaspaceSizes() : _committed(0), _used(0), _reserved(0) {} |
fa21c9537e6e
8035667: EventMetaspaceSummary doesn't report committed Metaspace memory
ehelin
parents:
17771
diff
changeset
|
71 MetaspaceSizes(size_t committed, size_t used, size_t reserved) : |
fa21c9537e6e
8035667: EventMetaspaceSummary doesn't report committed Metaspace memory
ehelin
parents:
17771
diff
changeset
|
72 _committed(committed), _used(used), _reserved(reserved) {} |
10405 | 73 |
17865
fa21c9537e6e
8035667: EventMetaspaceSummary doesn't report committed Metaspace memory
ehelin
parents:
17771
diff
changeset
|
74 size_t committed() const { return _committed; } |
10405 | 75 size_t used() const { return _used; } |
76 size_t reserved() const { return _reserved; } | |
77 }; | |
78 | |
79 class GCHeapSummary; | |
80 class PSHeapSummary; | |
81 | |
82 class GCHeapSummaryVisitor { | |
83 public: | |
84 virtual void visit(const GCHeapSummary* heap_summary) const = 0; | |
85 virtual void visit(const PSHeapSummary* heap_summary) const {} | |
86 }; | |
87 | |
88 class GCHeapSummary : public StackObj { | |
89 VirtualSpaceSummary _heap; | |
90 size_t _used; | |
91 | |
92 public: | |
93 GCHeapSummary() : | |
94 _heap(), _used(0) { } | |
95 GCHeapSummary(VirtualSpaceSummary& heap_space, size_t used) : | |
96 _heap(heap_space), _used(used) { } | |
97 | |
98 const VirtualSpaceSummary& heap() const { return _heap; } | |
99 size_t used() const { return _used; } | |
100 | |
101 virtual void accept(GCHeapSummaryVisitor* visitor) const { | |
102 visitor->visit(this); | |
103 } | |
104 }; | |
105 | |
106 class PSHeapSummary : public GCHeapSummary { | |
107 VirtualSpaceSummary _old; | |
108 SpaceSummary _old_space; | |
109 VirtualSpaceSummary _young; | |
110 SpaceSummary _eden; | |
111 SpaceSummary _from; | |
112 SpaceSummary _to; | |
113 public: | |
114 PSHeapSummary(VirtualSpaceSummary& heap_space, size_t heap_used, VirtualSpaceSummary old, SpaceSummary old_space, VirtualSpaceSummary young, SpaceSummary eden, SpaceSummary from, SpaceSummary to) : | |
115 GCHeapSummary(heap_space, heap_used), _old(old), _old_space(old_space), _young(young), _eden(eden), _from(from), _to(to) { } | |
116 const VirtualSpaceSummary& old() const { return _old; } | |
117 const SpaceSummary& old_space() const { return _old_space; } | |
118 const VirtualSpaceSummary& young() const { return _young; } | |
119 const SpaceSummary& eden() const { return _eden; } | |
120 const SpaceSummary& from() const { return _from; } | |
121 const SpaceSummary& to() const { return _to; } | |
122 | |
123 virtual void accept(GCHeapSummaryVisitor* visitor) const { | |
124 visitor->visit(this); | |
125 } | |
126 }; | |
127 | |
128 class MetaspaceSummary : public StackObj { | |
17767
537c8e21b118
8036696: Add metaspace gc threshold to metaspace summary trace event
ehelin
parents:
10405
diff
changeset
|
129 size_t _capacity_until_GC; |
10405 | 130 MetaspaceSizes _meta_space; |
131 MetaspaceSizes _data_space; | |
132 MetaspaceSizes _class_space; | |
17771
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
133 MetaspaceChunkFreeListSummary _metaspace_chunk_free_list_summary; |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
134 MetaspaceChunkFreeListSummary _class_chunk_free_list_summary; |
10405 | 135 |
136 public: | |
17771
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
137 MetaspaceSummary() : |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
138 _capacity_until_GC(0), |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
139 _meta_space(), |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
140 _data_space(), |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
141 _class_space(), |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
142 _metaspace_chunk_free_list_summary(), |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
143 _class_chunk_free_list_summary() |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
144 {} |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
145 MetaspaceSummary(size_t capacity_until_GC, |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
146 const MetaspaceSizes& meta_space, |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
147 const MetaspaceSizes& data_space, |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
148 const MetaspaceSizes& class_space, |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
149 const MetaspaceChunkFreeListSummary& metaspace_chunk_free_list_summary, |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
150 const MetaspaceChunkFreeListSummary& class_chunk_free_list_summary) : |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
151 _capacity_until_GC(capacity_until_GC), |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
152 _meta_space(meta_space), |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
153 _data_space(data_space), |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
154 _class_space(class_space), |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
155 _metaspace_chunk_free_list_summary(metaspace_chunk_free_list_summary), |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
156 _class_chunk_free_list_summary(class_chunk_free_list_summary) |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
157 {} |
10405 | 158 |
17767
537c8e21b118
8036696: Add metaspace gc threshold to metaspace summary trace event
ehelin
parents:
10405
diff
changeset
|
159 size_t capacity_until_GC() const { return _capacity_until_GC; } |
10405 | 160 const MetaspaceSizes& meta_space() const { return _meta_space; } |
161 const MetaspaceSizes& data_space() const { return _data_space; } | |
162 const MetaspaceSizes& class_space() const { return _class_space; } | |
17771
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
163 |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
164 const MetaspaceChunkFreeListSummary& metaspace_chunk_free_list_summary() const { |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
165 return _metaspace_chunk_free_list_summary; |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
166 } |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
167 |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
168 const MetaspaceChunkFreeListSummary& class_chunk_free_list_summary() const { |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
169 return _class_chunk_free_list_summary; |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
170 } |
9fdaa79b0c27
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
17767
diff
changeset
|
171 |
10405 | 172 }; |
173 | |
174 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCHEAPSUMMARY_HPP |