Mercurial > hg > graal-compiler
annotate src/share/vm/services/g1MemoryPool.hpp @ 18319:56cc1a799a60
(re)converted Value to an interface
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 07 Nov 2014 22:00:11 +0100 |
parents | 89152779163c |
children |
rev | line source |
---|---|
1089 | 1 /* |
17524 | 2 * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. |
1089 | 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:
1093
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1093
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:
1093
diff
changeset
|
21 * questions. |
1089 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_SERVICES_G1MEMORYPOOL_HPP |
26 #define SHARE_VM_SERVICES_G1MEMORYPOOL_HPP | |
27 | |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6842
diff
changeset
|
28 #include "utilities/macros.hpp" |
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6842
diff
changeset
|
29 #if INCLUDE_ALL_GCS |
3980
8229bd737950
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
3289
diff
changeset
|
30 #include "gc_implementation/g1/g1MonitoringSupport.hpp" |
1972 | 31 #include "services/memoryPool.hpp" |
32 #include "services/memoryUsage.hpp" | |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6842
diff
changeset
|
33 #endif // INCLUDE_ALL_GCS |
1972 | 34 |
1089 | 35 // This file contains the three classes that represent the memory |
36 // pools of the G1 spaces: G1EdenPool, G1SurvivorPool, and | |
37 // G1OldGenPool. In G1, unlike our other GCs, we do not have a | |
38 // physical space for each of those spaces. Instead, we allocate | |
39 // regions for all three spaces out of a single pool of regions (that | |
40 // pool basically covers the entire heap). As a result, the eden, | |
41 // survivor, and old gen are considered logical spaces in G1, as each | |
42 // is a set of non-contiguous regions. This is also reflected in the | |
43 // way we map them to memory pools here. The easiest way to have done | |
44 // this would have been to map the entire G1 heap to a single memory | |
45 // pool. However, it's helpful to show how large the eden and survivor | |
46 // get, as this does affect the performance and behavior of G1. Which | |
47 // is why we introduce the three memory pools implemented here. | |
48 // | |
3289
b52782ae3880
6946417: G1: Java VisualVM does not support G1 properly.
jmasa
parents:
1972
diff
changeset
|
49 // See comments in g1MonitoringSupport.hpp for additional details |
b52782ae3880
6946417: G1: Java VisualVM does not support G1 properly.
jmasa
parents:
1972
diff
changeset
|
50 // on this model. |
1089 | 51 // |
52 | |
53 // This class is shared by the three G1 memory pool classes | |
3980
8229bd737950
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
3289
diff
changeset
|
54 // (G1EdenPool, G1SurvivorPool, G1OldGenPool). |
1089 | 55 class G1MemoryPoolSuper : public CollectedMemoryPool { |
56 protected: | |
3980
8229bd737950
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
3289
diff
changeset
|
57 const static size_t _undefined_max = (size_t) -1; |
8229bd737950
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
3289
diff
changeset
|
58 G1MonitoringSupport* _g1mm; |
1093
afc30fccf324
6906565: G1: deal with compilation warning in g1MemoryPool.hpp
tonyp
parents:
1092
diff
changeset
|
59 |
1089 | 60 // Would only be called from subclasses. |
61 G1MemoryPoolSuper(G1CollectedHeap* g1h, | |
62 const char* name, | |
63 size_t init_size, | |
3980
8229bd737950
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
3289
diff
changeset
|
64 size_t max_size, |
1089 | 65 bool support_usage_threshold); |
66 }; | |
67 | |
68 // Memory pool that represents the G1 eden. | |
69 class G1EdenPool : public G1MemoryPoolSuper { | |
70 public: | |
71 G1EdenPool(G1CollectedHeap* g1h); | |
72 | |
73 size_t used_in_bytes() { | |
3980
8229bd737950
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
3289
diff
changeset
|
74 return _g1mm->eden_space_used(); |
1089 | 75 } |
1093
afc30fccf324
6906565: G1: deal with compilation warning in g1MemoryPool.hpp
tonyp
parents:
1092
diff
changeset
|
76 size_t max_size() const { |
3980
8229bd737950
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
3289
diff
changeset
|
77 return _undefined_max; |
1089 | 78 } |
79 MemoryUsage get_memory_usage(); | |
80 }; | |
81 | |
82 // Memory pool that represents the G1 survivor. | |
83 class G1SurvivorPool : public G1MemoryPoolSuper { | |
84 public: | |
85 G1SurvivorPool(G1CollectedHeap* g1h); | |
86 | |
87 size_t used_in_bytes() { | |
3980
8229bd737950
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
3289
diff
changeset
|
88 return _g1mm->survivor_space_used(); |
1089 | 89 } |
1093
afc30fccf324
6906565: G1: deal with compilation warning in g1MemoryPool.hpp
tonyp
parents:
1092
diff
changeset
|
90 size_t max_size() const { |
3980
8229bd737950
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
3289
diff
changeset
|
91 return _undefined_max; |
1089 | 92 } |
93 MemoryUsage get_memory_usage(); | |
94 }; | |
95 | |
96 // Memory pool that represents the G1 old gen. | |
97 class G1OldGenPool : public G1MemoryPoolSuper { | |
98 public: | |
99 G1OldGenPool(G1CollectedHeap* g1h); | |
100 | |
101 size_t used_in_bytes() { | |
3980
8229bd737950
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
3289
diff
changeset
|
102 return _g1mm->old_space_used(); |
1089 | 103 } |
1093
afc30fccf324
6906565: G1: deal with compilation warning in g1MemoryPool.hpp
tonyp
parents:
1092
diff
changeset
|
104 size_t max_size() const { |
4832
a8a126788ea0
7078465: G1: Don't use the undefined value (-1) for the G1 old memory pool max size
tonyp
parents:
3980
diff
changeset
|
105 return _g1mm->old_gen_max(); |
1089 | 106 } |
107 MemoryUsage get_memory_usage(); | |
108 }; | |
1972 | 109 |
110 #endif // SHARE_VM_SERVICES_G1MEMORYPOOL_HPP |