author | stuefe |
Tue, 26 Nov 2019 16:21:29 +0100 | |
branch | stuefe-new-metaspace-branch |
changeset 59272 | 54750b448264 |
parent 58063 | bdf136b8ae0e |
permissions | -rw-r--r-- |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52925
diff
changeset
|
2 |
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
4 |
* |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
8 |
* |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
13 |
* accompanied this code). |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
14 |
* |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
18 |
* |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
21 |
* questions. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
22 |
* |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
23 |
*/ |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52925
diff
changeset
|
24 |
#ifndef SHARE_MEMORY_METASPACE_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52925
diff
changeset
|
25 |
#define SHARE_MEMORY_METASPACE_HPP |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
26 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
27 |
#include "memory/allocation.hpp" |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
28 |
#include "memory/memRegion.hpp" |
23470
ff2a7ea4225d
8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents:
23469
diff
changeset
|
29 |
#include "memory/metaspaceChunkFreeListSummary.hpp" |
30291
54cdc5c1a9cb
8068352: Move virtualspace.* out of src/share/vm/runtime to memory directory
coleenp
parents:
26938
diff
changeset
|
30 |
#include "memory/virtualspace.hpp" |
57875
427b38332f20
8229836: Remove include of globals.hpp from allocation.hpp
stefank
parents:
55586
diff
changeset
|
31 |
#include "runtime/globals.hpp" |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
32 |
#include "utilities/exceptions.hpp" |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
33 |
#include "utilities/globalDefinitions.hpp" |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
34 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
35 |
// Metaspace |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
36 |
// |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
37 |
// Metaspaces are Arenas for the VM's metadata. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
38 |
// They are allocated one per class loader object, and one for the null |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
39 |
// bootstrap class loader |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
40 |
// |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
41 |
// block X ---+ +-------------------+ |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
42 |
// | | Virtualspace | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
43 |
// | | | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
44 |
// | | | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
45 |
// | |-------------------| |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
46 |
// | || Chunk | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
47 |
// | || | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
48 |
// | ||---------- | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
49 |
// +------>||| block 0 | | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
50 |
// ||---------- | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
51 |
// ||| block 1 | | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
52 |
// ||---------- | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
53 |
// || | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
54 |
// |-------------------| |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
55 |
// | | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
56 |
// | | |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
57 |
// +-------------------+ |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
58 |
// |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
59 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
60 |
class ClassLoaderData; |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
61 |
class MetaspaceShared; |
23465
14790e4d53ec
8036698: Add trace event for updates to metaspace gc threshold
ehelin
parents:
22872
diff
changeset
|
62 |
class MetaspaceTracer; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
63 |
class outputStream; |
50193 | 64 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
65 |
|
49980 | 66 |
namespace metaspace { |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
67 |
class MetaspaceSizesSnapshot; |
50193 | 68 |
} |
49980 | 69 |
|
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
70 |
////////////////// Metaspace /////////////////////// |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
71 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
72 |
// Metaspaces each have a SpaceManager and allocations |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
73 |
// are done by the SpaceManager. Allocations are done |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
74 |
// out of the current Metachunk. When the current Metachunk |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
75 |
// is exhausted, the SpaceManager gets a new one from |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
76 |
// the current VirtualSpace. When the VirtualSpace is exhausted |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
77 |
// the SpaceManager gets a new one. The SpaceManager |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
78 |
// also manages freelists of available Chunks. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
79 |
// |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
80 |
// Currently the space manager maintains the list of |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
81 |
// virtual spaces and the list of chunks in use. Its |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
82 |
// allocate() method returns a block for use as a |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
83 |
// quantum of metadata. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
84 |
|
49401
0c71baee49a7
8199431: Split up class Metaspace into a static and a non-static part
stuefe
parents:
49389
diff
changeset
|
85 |
// Namespace for important central static functions |
0c71baee49a7
8199431: Split up class Metaspace into a static and a non-static part
stuefe
parents:
49389
diff
changeset
|
86 |
// (auxiliary stuff goes into MetaspaceUtils) |
0c71baee49a7
8199431: Split up class Metaspace into a static and a non-static part
stuefe
parents:
49389
diff
changeset
|
87 |
class Metaspace : public AllStatic { |
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
88 |
public: |
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
89 |
// Will eventually be moved to metaspaceEnums.hpp and into the metaspace::.. namespace; |
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
90 |
// for now keep here to keep diff in non-metaspace coding small. |
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
91 |
enum MetadataType { |
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
92 |
ClassType, |
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
93 |
NonClassType, |
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
94 |
MetadataTypeCount |
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
95 |
}; |
49401
0c71baee49a7
8199431: Split up class Metaspace into a static and a non-static part
stuefe
parents:
49389
diff
changeset
|
96 |
|
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
97 |
private: |
46746
ea379ebb9447
8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents:
46324
diff
changeset
|
98 |
friend class MetaspaceShared; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
99 |
|
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
100 |
// Base and size of the compressed class space. |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
101 |
static MetaWord* _compressed_class_space_base; |
21188
d053e4e8f901
8024927: Nashorn performance regression with CompressedOops
coleenp
parents:
21186
diff
changeset
|
102 |
static size_t _compressed_class_space_size; |
19319
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18025
diff
changeset
|
103 |
|
20406
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
104 |
static size_t _commit_alignment; |
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
105 |
static size_t _reserve_alignment; |
46746
ea379ebb9447
8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents:
46324
diff
changeset
|
106 |
DEBUG_ONLY(static bool _frozen;) |
20406
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
107 |
|
23465
14790e4d53ec
8036698: Add trace event for updates to metaspace gc threshold
ehelin
parents:
22872
diff
changeset
|
108 |
static const MetaspaceTracer* _tracer; |
14790e4d53ec
8036698: Add trace event for updates to metaspace gc threshold
ehelin
parents:
22872
diff
changeset
|
109 |
|
55586
014c8cd323af
8227032: MetaspaceUtils::print_report crashes when called before initialization
stuefe
parents:
55576
diff
changeset
|
110 |
static bool _initialized; |
014c8cd323af
8227032: MetaspaceUtils::print_report crashes when called before initialization
stuefe
parents:
55576
diff
changeset
|
111 |
|
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
112 |
static MetaWord* compressed_class_space_base() { return _compressed_class_space_base; } |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
113 |
static size_t compressed_class_space_size() { return _compressed_class_space_size; } |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
114 |
|
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
115 |
public: |
49365 | 116 |
|
23465
14790e4d53ec
8036698: Add trace event for updates to metaspace gc threshold
ehelin
parents:
22872
diff
changeset
|
117 |
static const MetaspaceTracer* tracer() { return _tracer; } |
46746
ea379ebb9447
8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents:
46324
diff
changeset
|
118 |
static void freeze() { |
ea379ebb9447
8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents:
46324
diff
changeset
|
119 |
assert(DumpSharedSpaces, "sanity"); |
ea379ebb9447
8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents:
46324
diff
changeset
|
120 |
DEBUG_ONLY(_frozen = true;) |
ea379ebb9447
8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents:
46324
diff
changeset
|
121 |
} |
49401
0c71baee49a7
8199431: Split up class Metaspace into a static and a non-static part
stuefe
parents:
49389
diff
changeset
|
122 |
static void assert_not_frozen() { |
0c71baee49a7
8199431: Split up class Metaspace into a static and a non-static part
stuefe
parents:
49389
diff
changeset
|
123 |
assert(!_frozen, "sanity"); |
0c71baee49a7
8199431: Split up class Metaspace into a static and a non-static part
stuefe
parents:
49389
diff
changeset
|
124 |
} |
47599
0fb1d501c408
8174986: CDS archived java heap region may not compatible with AOT
jiangli
parents:
47553
diff
changeset
|
125 |
#ifdef _LP64 |
0fb1d501c408
8174986: CDS archived java heap region may not compatible with AOT
jiangli
parents:
47553
diff
changeset
|
126 |
static void allocate_metaspace_compressed_klass_ptrs(char* requested_addr, address cds_base); |
0fb1d501c408
8174986: CDS archived java heap region may not compatible with AOT
jiangli
parents:
47553
diff
changeset
|
127 |
#endif |
0fb1d501c408
8174986: CDS archived java heap region may not compatible with AOT
jiangli
parents:
47553
diff
changeset
|
128 |
|
20081
e26536e86a5c
8025096: Move the ChunkManager instances out of the VirtualSpaceLists
stefank
parents:
19989
diff
changeset
|
129 |
private: |
17858
c292f8791cca
8014912: Restore PrintSharedSpaces functionality after NPG
iklam
parents:
17628
diff
changeset
|
130 |
|
19319
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18025
diff
changeset
|
131 |
#ifdef _LP64 |
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18025
diff
changeset
|
132 |
static void set_narrow_klass_base_and_shift(address metaspace_base, address cds_base); |
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18025
diff
changeset
|
133 |
|
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18025
diff
changeset
|
134 |
// Returns true if can use CDS with metaspace allocated as specified address. |
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18025
diff
changeset
|
135 |
static bool can_use_cds_with_metaspace_addr(char* metaspace_base, address cds_base); |
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18025
diff
changeset
|
136 |
|
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18025
diff
changeset
|
137 |
static void initialize_class_space(ReservedSpace rs); |
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18025
diff
changeset
|
138 |
#endif |
21186
db851068711f
8026822: metaspace/flags/maxMetaspaceSize throws OOM of unexpected type.java.lang.OutOfMemoryError: Compressed class space
hseigel
parents:
20729
diff
changeset
|
139 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
140 |
public: |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
141 |
|
20406
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
142 |
static void ergo_initialize(); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
143 |
static void global_initialize(); |
24847
37c354b113fe
8042933: assert(capacity_until_gc >= committed_bytes) failed
ehelin
parents:
24457
diff
changeset
|
144 |
static void post_initialize(); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
145 |
|
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
146 |
// The alignment at which Metaspace mappings are reserved. |
20406
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
147 |
static size_t reserve_alignment() { return _reserve_alignment; } |
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
148 |
static size_t reserve_alignment_words() { return _reserve_alignment / BytesPerWord; } |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
149 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
150 |
// The granularity at which Metaspace is committed and uncommitted. |
20406
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
151 |
static size_t commit_alignment() { return _commit_alignment; } |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
152 |
static size_t commit_words() { return _commit_alignment / BytesPerWord; } |
20406
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
153 |
|
20729 | 154 |
static MetaWord* allocate(ClassLoaderData* loader_data, size_t word_size, |
46746
ea379ebb9447
8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents:
46324
diff
changeset
|
155 |
MetaspaceObj::Type type, TRAPS); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
156 |
|
24457
0e20b36df5c4
8038212: Method::is_valid_method() check has performance regression impact for stackwalking
coleenp
parents:
23854
diff
changeset
|
157 |
static bool contains(const void* ptr); |
46324
8764956ec928
8005165: Remove CPU-dependent code in self-patching vtables
iklam
parents:
42615
diff
changeset
|
158 |
static bool contains_non_shared(const void* ptr); |
24457
0e20b36df5c4
8038212: Method::is_valid_method() check has performance regression impact for stackwalking
coleenp
parents:
23854
diff
changeset
|
159 |
|
17101 | 160 |
// Free empty virtualspaces |
161 |
static void purge(); |
|
162 |
||
20406
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
163 |
static void report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, |
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
164 |
MetaspaceObj::Type type, Metaspace::MetadataType mdtype, TRAPS); |
23468
6bb416a59349
8036699: Add trace event when a metaspace allocation fails
ehelin
parents:
23465
diff
changeset
|
165 |
|
32397
d1ad9a7c4a41
8133984: print_compressed_class_space() is only defined in 64-bit VM
kvn
parents:
31335
diff
changeset
|
166 |
static void print_compressed_class_space(outputStream* st, const char* requested_addr = 0) NOT_LP64({}); |
31335
60081f497e75
8035074: hs_err improvement: Add time zone information in the hs_err file
coleenp
parents:
30291
diff
changeset
|
167 |
|
46746
ea379ebb9447
8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents:
46324
diff
changeset
|
168 |
// Return TRUE only if UseCompressedClassPointers is True. |
19319
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18025
diff
changeset
|
169 |
static bool using_class_space() { |
46746
ea379ebb9447
8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents:
46324
diff
changeset
|
170 |
return NOT_LP64(false) LP64_ONLY(UseCompressedClassPointers); |
19319
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18025
diff
changeset
|
171 |
} |
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18025
diff
changeset
|
172 |
|
55586
014c8cd323af
8227032: MetaspaceUtils::print_report crashes when called before initialization
stuefe
parents:
55576
diff
changeset
|
173 |
static bool initialized() { return _initialized; } |
014c8cd323af
8227032: MetaspaceUtils::print_report crashes when called before initialization
stuefe
parents:
55576
diff
changeset
|
174 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
175 |
}; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
176 |
|
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
177 |
////////////////// MetaspaceGC /////////////////////// |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
178 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
179 |
// Metaspace are deallocated when their class loader are GC'ed. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
180 |
// This class implements a policy for inducing GC's to recover |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
181 |
// Metaspaces. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
182 |
|
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
183 |
class MetaspaceGCThresholdUpdater : public AllStatic { |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
184 |
public: |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
185 |
enum Type { |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
186 |
ComputeNewSize, |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
187 |
ExpandAndAllocate, |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
188 |
Last |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
189 |
}; |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
190 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
191 |
static const char* to_string(MetaspaceGCThresholdUpdater::Type updater) { |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
192 |
switch (updater) { |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
193 |
case ComputeNewSize: |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
194 |
return "compute_new_size"; |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
195 |
case ExpandAndAllocate: |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
196 |
return "expand_and_allocate"; |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
197 |
default: |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
198 |
assert(false, "Got bad updater: %d", (int) updater); |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
199 |
return NULL; |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
200 |
}; |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
201 |
} |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
202 |
}; |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
203 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
204 |
class MetaspaceGC : public AllStatic { |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
205 |
|
20406
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
206 |
// The current high-water-mark for inducing a GC. |
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
207 |
// When committed memory of all metaspaces reaches this value, |
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
208 |
// a GC is induced and the value is increased. Size is in bytes. |
50119
bf9177eac58d
8189271: Metaspace::_capacity_until_GC should be size_t
aharlap
parents:
49980
diff
changeset
|
209 |
static volatile size_t _capacity_until_GC; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
210 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
211 |
// For a CMS collection, signal that a concurrent collection should |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
212 |
// be started. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
213 |
static bool _should_concurrent_collect; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
214 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
215 |
static uint _shrink_factor; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
216 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
217 |
static size_t shrink_factor() { return _shrink_factor; } |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
218 |
void set_shrink_factor(uint v) { _shrink_factor = v; } |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
219 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
220 |
public: |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
221 |
|
24847
37c354b113fe
8042933: assert(capacity_until_gc >= committed_bytes) failed
ehelin
parents:
24457
diff
changeset
|
222 |
static void initialize(); |
37c354b113fe
8042933: assert(capacity_until_gc >= committed_bytes) failed
ehelin
parents:
24457
diff
changeset
|
223 |
static void post_initialize(); |
20406
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
224 |
|
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
225 |
static size_t capacity_until_GC(); |
26938
e0b35f8104a7
8049599: MetaspaceGC::_capacity_until_GC can overflow
ehelin
parents:
26934
diff
changeset
|
226 |
static bool inc_capacity_until_GC(size_t v, |
e0b35f8104a7
8049599: MetaspaceGC::_capacity_until_GC can overflow
ehelin
parents:
26934
diff
changeset
|
227 |
size_t* new_cap_until_GC = NULL, |
53602
d1282cd2c1fc
8217432: MetaspaceGC::_capacity_until_GC exceeds MaxMetaspaceSize
ysuenaga
parents:
53547
diff
changeset
|
228 |
size_t* old_cap_until_GC = NULL, |
d1282cd2c1fc
8217432: MetaspaceGC::_capacity_until_GC exceeds MaxMetaspaceSize
ysuenaga
parents:
53547
diff
changeset
|
229 |
bool* can_retry = NULL); |
20406
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
230 |
static size_t dec_capacity_until_GC(size_t v); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
231 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
232 |
static bool should_concurrent_collect() { return _should_concurrent_collect; } |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
233 |
static void set_should_concurrent_collect(bool v) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
234 |
_should_concurrent_collect = v; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
235 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
236 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
237 |
// The amount to increase the high-water-mark (_capacity_until_GC) |
20406
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
238 |
static size_t delta_capacity_until_GC(size_t bytes); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
239 |
|
20406
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
240 |
// Tells if we have can expand metaspace without hitting set limits. |
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
241 |
static bool can_expand(size_t words, bool is_class); |
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
242 |
|
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
243 |
// Returns amount that we can expand without hitting a GC, |
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
244 |
// measured in words. |
934f0b12daa9
8024547: MaxMetaspaceSize should limit the committed memory used by the metaspaces
stefank
parents:
20306
diff
changeset
|
245 |
static size_t allowed_expansion(); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
246 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
247 |
// Calculate the new high-water mark at which to induce |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
248 |
// a GC. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
249 |
static void compute_new_size(); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
250 |
}; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff
changeset
|
251 |
|
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
252 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
253 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
254 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
255 |
class MetaspaceUtils : AllStatic { |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
256 |
public: |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
257 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
258 |
// Committed space actually in use by Metadata |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
259 |
static size_t used_words(); |
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
260 |
static size_t used_words(Metaspace::MetadataType mdtype); |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
261 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
262 |
// Space committed for Metaspace |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
263 |
static size_t committed_words(); |
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
264 |
static size_t committed_words(Metaspace::MetadataType mdtype); |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
265 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
266 |
// Space reserved for Metaspace |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
267 |
static size_t reserved_words(); |
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
268 |
static size_t reserved_words(Metaspace::MetadataType mdtype); |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
269 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
270 |
// _bytes() variants for convenience... |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
271 |
static size_t used_bytes() { return used_words() * BytesPerWord; } |
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
272 |
static size_t used_bytes(Metaspace::MetadataType mdtype) { return used_words(mdtype) * BytesPerWord; } |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
273 |
static size_t committed_bytes() { return committed_words() * BytesPerWord; } |
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
274 |
static size_t committed_bytes(Metaspace::MetadataType mdtype) { return committed_words(mdtype) * BytesPerWord; } |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
275 |
static size_t reserved_bytes() { return reserved_words() * BytesPerWord; } |
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
276 |
static size_t reserved_bytes(Metaspace::MetadataType mdtype) { return reserved_words(mdtype) * BytesPerWord; } |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
277 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
278 |
// TODO. Do we need this really? This number is kind of uninformative. |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
279 |
static size_t capacity_bytes() { return 0; } |
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
280 |
static size_t capacity_bytes(Metaspace::MetadataType mdtype) { return 0; } |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
281 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
282 |
// Todo. Consolidate. |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
283 |
// Committed space in freelists |
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
284 |
static size_t free_chunks_total_words(Metaspace::MetadataType mdtype); |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
285 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
286 |
// Todo. Implement or Consolidate. |
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
287 |
static MetaspaceChunkFreeListSummary chunk_free_list_summary(Metaspace::MetadataType mdtype) { |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
288 |
return MetaspaceChunkFreeListSummary(0,0,0,0,0,0,0,0); |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
289 |
} |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
290 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
291 |
// Log change in used metadata. |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
292 |
static void print_metaspace_change(const metaspace::MetaspaceSizesSnapshot& pre_meta_values); |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
293 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
294 |
// Prints an ASCII representation of the given space. |
59272
54750b448264
Metadatatype back to metaspace.hpp to reduce patch size
stuefe
parents:
58063
diff
changeset
|
295 |
static void print_metaspace_map(outputStream* out, Metaspace::MetadataType mdtype); |
58063
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
296 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
297 |
// This will print out a basic metaspace usage report but |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
298 |
// unlike print_report() is guaranteed not to lock or to walk the CLDG. |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
299 |
static void print_basic_report(outputStream* st, size_t scale = 0); |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
300 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
301 |
// Prints a report about the current metaspace state. |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
302 |
// Function will walk the CLDG and will lock the expand lock; if that is not |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
303 |
// convenient, use print_basic_report() instead. |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
304 |
static void print_full_report(outputStream* out, size_t scale = 0); |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
305 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
306 |
static void print_on(outputStream * out); |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
307 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
308 |
DEBUG_ONLY(static void verify(bool slow);) |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
309 |
|
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
310 |
}; |
bdf136b8ae0e
Initial changes for new metaspace. Only tested for Linux x64.
stuefe
parents:
57875
diff
changeset
|
311 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52925
diff
changeset
|
312 |
#endif // SHARE_MEMORY_METASPACE_HPP |