author | tschatzl |
Wed, 17 Jul 2019 16:33:19 +0200 | |
changeset 55722 | 5ee183a90e65 |
parent 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
4459 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
51498
diff
changeset
|
2 |
* Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. |
4459 | 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:
4463
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4463
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:
4463
diff
changeset
|
21 |
* questions. |
4459 | 22 |
* |
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
51498
diff
changeset
|
25 |
#ifndef SHARE_GC_G1_G1MEMORYPOOL_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
51498
diff
changeset
|
26 |
#define SHARE_GC_G1_G1MEMORYPOOL_HPP |
7397 | 27 |
|
30764 | 28 |
#include "gc/g1/g1MonitoringSupport.hpp" |
7397 | 29 |
#include "services/memoryPool.hpp" |
30 |
#include "services/memoryUsage.hpp" |
|
31 |
||
4459 | 32 |
// This file contains the three classes that represent the memory |
33 |
// pools of the G1 spaces: G1EdenPool, G1SurvivorPool, and |
|
34 |
// G1OldGenPool. In G1, unlike our other GCs, we do not have a |
|
35 |
// physical space for each of those spaces. Instead, we allocate |
|
36 |
// regions for all three spaces out of a single pool of regions (that |
|
37 |
// pool basically covers the entire heap). As a result, the eden, |
|
38 |
// survivor, and old gen are considered logical spaces in G1, as each |
|
39 |
// is a set of non-contiguous regions. This is also reflected in the |
|
40 |
// way we map them to memory pools here. The easiest way to have done |
|
41 |
// this would have been to map the entire G1 heap to a single memory |
|
42 |
// pool. However, it's helpful to show how large the eden and survivor |
|
43 |
// get, as this does affect the performance and behavior of G1. Which |
|
44 |
// is why we introduce the three memory pools implemented here. |
|
45 |
// |
|
9338
05ee447bd420
6946417: G1: Java VisualVM does not support G1 properly.
jmasa
parents:
7397
diff
changeset
|
46 |
// See comments in g1MonitoringSupport.hpp for additional details |
05ee447bd420
6946417: G1: Java VisualVM does not support G1 properly.
jmasa
parents:
7397
diff
changeset
|
47 |
// on this model. |
4459 | 48 |
// |
49 |
||
48168
cb5d2d4453d0
8191564: Refactor GC related servicability code into GC specific subclasses
rkennke
parents:
47216
diff
changeset
|
50 |
class G1CollectedHeap; |
cb5d2d4453d0
8191564: Refactor GC related servicability code into GC specific subclasses
rkennke
parents:
47216
diff
changeset
|
51 |
|
4459 | 52 |
// This class is shared by the three G1 memory pool classes |
10671
431ff8629f97
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
9338
diff
changeset
|
53 |
// (G1EdenPool, G1SurvivorPool, G1OldGenPool). |
4459 | 54 |
class G1MemoryPoolSuper : public CollectedMemoryPool { |
55 |
protected: |
|
10671
431ff8629f97
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
9338
diff
changeset
|
56 |
G1MonitoringSupport* _g1mm; |
4463
699f80df7faa
6906565: G1: deal with compilation warning in g1MemoryPool.hpp
tonyp
parents:
4462
diff
changeset
|
57 |
|
4459 | 58 |
// Would only be called from subclasses. |
59 |
G1MemoryPoolSuper(G1CollectedHeap* g1h, |
|
60 |
const char* name, |
|
61 |
size_t init_size, |
|
10671
431ff8629f97
7075646: G1: fix inconsistencies in the monitoring data
tonyp
parents:
9338
diff
changeset
|
62 |
size_t max_size, |
4459 | 63 |
bool support_usage_threshold); |
64 |
}; |
|
65 |
||
66 |
// Memory pool that represents the G1 eden. |
|
67 |
class G1EdenPool : public G1MemoryPoolSuper { |
|
68 |
public: |
|
51498 | 69 |
G1EdenPool(G1CollectedHeap* g1h, size_t initial_size); |
4459 | 70 |
|
51498 | 71 |
size_t used_in_bytes() { return _g1mm->eden_space_used(); } |
72 |
||
4459 | 73 |
MemoryUsage get_memory_usage(); |
74 |
}; |
|
75 |
||
76 |
// Memory pool that represents the G1 survivor. |
|
77 |
class G1SurvivorPool : public G1MemoryPoolSuper { |
|
78 |
public: |
|
51498 | 79 |
G1SurvivorPool(G1CollectedHeap* g1h, size_t initial_size); |
4459 | 80 |
|
51498 | 81 |
size_t used_in_bytes() { return _g1mm->survivor_space_used(); } |
82 |
||
4459 | 83 |
MemoryUsage get_memory_usage(); |
84 |
}; |
|
85 |
||
86 |
// Memory pool that represents the G1 old gen. |
|
87 |
class G1OldGenPool : public G1MemoryPoolSuper { |
|
88 |
public: |
|
51498 | 89 |
G1OldGenPool(G1CollectedHeap* g1h, size_t initial_size, size_t max_size); |
4459 | 90 |
|
51498 | 91 |
size_t used_in_bytes() { return _g1mm->old_gen_used(); } |
92 |
||
4459 | 93 |
MemoryUsage get_memory_usage(); |
94 |
}; |
|
7397 | 95 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
51498
diff
changeset
|
96 |
#endif // SHARE_GC_G1_G1MEMORYPOOL_HPP |