Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
e7fb36ac
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e7fb36ac
编写于
3月 31, 2014
作者:
E
ehelin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8038934: Remove prefix allocated_ from methods and variables in Metaspace
Reviewed-by: jmasa, coleenp
上级
60490749
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
69 addition
and
69 deletion
+69
-69
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+1
-1
src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
+1
-1
src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
...are/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
+1
-1
src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
.../gc_implementation/parallelScavenge/psParallelCompact.cpp
+1
-1
src/share/vm/gc_interface/collectedHeap.cpp
src/share/vm/gc_interface/collectedHeap.cpp
+3
-3
src/share/vm/memory/genCollectedHeap.cpp
src/share/vm/memory/genCollectedHeap.cpp
+1
-1
src/share/vm/memory/metaspace.cpp
src/share/vm/memory/metaspace.cpp
+36
-36
src/share/vm/memory/metaspace.hpp
src/share/vm/memory/metaspace.hpp
+21
-21
src/share/vm/memory/metaspaceCounters.cpp
src/share/vm/memory/metaspaceCounters.cpp
+2
-2
src/share/vm/services/memoryPool.cpp
src/share/vm/services/memoryPool.cpp
+2
-2
未找到文件。
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
浏览文件 @
e7fb36ac
...
@@ -1288,7 +1288,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
...
@@ -1288,7 +1288,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
print_heap_before_gc
();
print_heap_before_gc
();
trace_heap_before_gc
(
gc_tracer
);
trace_heap_before_gc
(
gc_tracer
);
size_t
metadata_prev_used
=
MetaspaceAux
::
allocated_
used_bytes
();
size_t
metadata_prev_used
=
MetaspaceAux
::
used_bytes
();
verify_region_sets_optional
();
verify_region_sets_optional
();
...
...
src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
浏览文件 @
e7fb36ac
...
@@ -1204,7 +1204,7 @@ void G1CollectorPolicy::record_heap_size_info_at_start(bool full) {
...
@@ -1204,7 +1204,7 @@ void G1CollectorPolicy::record_heap_size_info_at_start(bool full) {
(
_young_list_target_length
*
HeapRegion
::
GrainBytes
)
-
_survivor_used_bytes_before_gc
;
(
_young_list_target_length
*
HeapRegion
::
GrainBytes
)
-
_survivor_used_bytes_before_gc
;
if
(
full
)
{
if
(
full
)
{
_metaspace_used_bytes_before_gc
=
MetaspaceAux
::
allocated_
used_bytes
();
_metaspace_used_bytes_before_gc
=
MetaspaceAux
::
used_bytes
();
}
}
}
}
...
...
src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
浏览文件 @
e7fb36ac
...
@@ -184,7 +184,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
...
@@ -184,7 +184,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
size_t
prev_used
=
heap
->
used
();
size_t
prev_used
=
heap
->
used
();
// Capture metadata size before collection for sizing.
// Capture metadata size before collection for sizing.
size_t
metadata_prev_used
=
MetaspaceAux
::
allocated_
used_bytes
();
size_t
metadata_prev_used
=
MetaspaceAux
::
used_bytes
();
// For PrintGCDetails
// For PrintGCDetails
size_t
old_gen_prev_used
=
old_gen
->
used_in_bytes
();
size_t
old_gen_prev_used
=
old_gen
->
used_in_bytes
();
...
...
src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
浏览文件 @
e7fb36ac
...
@@ -927,7 +927,7 @@ public:
...
@@ -927,7 +927,7 @@ public:
_heap_used
=
heap
->
used
();
_heap_used
=
heap
->
used
();
_young_gen_used
=
heap
->
young_gen
()
->
used_in_bytes
();
_young_gen_used
=
heap
->
young_gen
()
->
used_in_bytes
();
_old_gen_used
=
heap
->
old_gen
()
->
used_in_bytes
();
_old_gen_used
=
heap
->
old_gen
()
->
used_in_bytes
();
_metadata_used
=
MetaspaceAux
::
allocated_
used_bytes
();
_metadata_used
=
MetaspaceAux
::
used_bytes
();
};
};
size_t
heap_used
()
const
{
return
_heap_used
;
}
size_t
heap_used
()
const
{
return
_heap_used
;
}
...
...
src/share/vm/gc_interface/collectedHeap.cpp
浏览文件 @
e7fb36ac
...
@@ -86,15 +86,15 @@ GCHeapSummary CollectedHeap::create_heap_summary() {
...
@@ -86,15 +86,15 @@ GCHeapSummary CollectedHeap::create_heap_summary() {
MetaspaceSummary
CollectedHeap
::
create_metaspace_summary
()
{
MetaspaceSummary
CollectedHeap
::
create_metaspace_summary
()
{
const
MetaspaceSizes
meta_space
(
const
MetaspaceSizes
meta_space
(
MetaspaceAux
::
committed_bytes
(),
MetaspaceAux
::
committed_bytes
(),
MetaspaceAux
::
allocated_
used_bytes
(),
MetaspaceAux
::
used_bytes
(),
MetaspaceAux
::
reserved_bytes
());
MetaspaceAux
::
reserved_bytes
());
const
MetaspaceSizes
data_space
(
const
MetaspaceSizes
data_space
(
MetaspaceAux
::
committed_bytes
(
Metaspace
::
NonClassType
),
MetaspaceAux
::
committed_bytes
(
Metaspace
::
NonClassType
),
MetaspaceAux
::
allocated_
used_bytes
(
Metaspace
::
NonClassType
),
MetaspaceAux
::
used_bytes
(
Metaspace
::
NonClassType
),
MetaspaceAux
::
reserved_bytes
(
Metaspace
::
NonClassType
));
MetaspaceAux
::
reserved_bytes
(
Metaspace
::
NonClassType
));
const
MetaspaceSizes
class_space
(
const
MetaspaceSizes
class_space
(
MetaspaceAux
::
committed_bytes
(
Metaspace
::
ClassType
),
MetaspaceAux
::
committed_bytes
(
Metaspace
::
ClassType
),
MetaspaceAux
::
allocated_
used_bytes
(
Metaspace
::
ClassType
),
MetaspaceAux
::
used_bytes
(
Metaspace
::
ClassType
),
MetaspaceAux
::
reserved_bytes
(
Metaspace
::
ClassType
));
MetaspaceAux
::
reserved_bytes
(
Metaspace
::
ClassType
));
const
MetaspaceChunkFreeListSummary
&
ms_chunk_free_list_summary
=
const
MetaspaceChunkFreeListSummary
&
ms_chunk_free_list_summary
=
...
...
src/share/vm/memory/genCollectedHeap.cpp
浏览文件 @
e7fb36ac
...
@@ -374,7 +374,7 @@ void GenCollectedHeap::do_collection(bool full,
...
@@ -374,7 +374,7 @@ void GenCollectedHeap::do_collection(bool full,
ClearedAllSoftRefs
casr
(
do_clear_all_soft_refs
,
collector_policy
());
ClearedAllSoftRefs
casr
(
do_clear_all_soft_refs
,
collector_policy
());
const
size_t
metadata_prev_used
=
MetaspaceAux
::
allocated_
used_bytes
();
const
size_t
metadata_prev_used
=
MetaspaceAux
::
used_bytes
();
print_heap_before_gc
();
print_heap_before_gc
();
...
...
src/share/vm/memory/metaspace.cpp
浏览文件 @
e7fb36ac
...
@@ -1447,7 +1447,7 @@ void MetaspaceGC::compute_new_size() {
...
@@ -1447,7 +1447,7 @@ void MetaspaceGC::compute_new_size() {
uint
current_shrink_factor
=
_shrink_factor
;
uint
current_shrink_factor
=
_shrink_factor
;
_shrink_factor
=
0
;
_shrink_factor
=
0
;
const
size_t
used_after_gc
=
MetaspaceAux
::
allocated_
capacity_bytes
();
const
size_t
used_after_gc
=
MetaspaceAux
::
capacity_bytes
();
const
size_t
capacity_until_GC
=
MetaspaceGC
::
capacity_until_GC
();
const
size_t
capacity_until_GC
=
MetaspaceGC
::
capacity_until_GC
();
const
double
minimum_free_percentage
=
MinMetaspaceFreeRatio
/
100.0
;
const
double
minimum_free_percentage
=
MinMetaspaceFreeRatio
/
100.0
;
...
@@ -2537,8 +2537,8 @@ void SpaceManager::mangle_freed_chunks() {
...
@@ -2537,8 +2537,8 @@ void SpaceManager::mangle_freed_chunks() {
// MetaspaceAux
// MetaspaceAux
size_t
MetaspaceAux
::
_
allocated_
capacity_words
[]
=
{
0
,
0
};
size_t
MetaspaceAux
::
_capacity_words
[]
=
{
0
,
0
};
size_t
MetaspaceAux
::
_
allocated_
used_words
[]
=
{
0
,
0
};
size_t
MetaspaceAux
::
_used_words
[]
=
{
0
,
0
};
size_t
MetaspaceAux
::
free_bytes
(
Metaspace
::
MetadataType
mdtype
)
{
size_t
MetaspaceAux
::
free_bytes
(
Metaspace
::
MetadataType
mdtype
)
{
VirtualSpaceList
*
list
=
Metaspace
::
get_space_list
(
mdtype
);
VirtualSpaceList
*
list
=
Metaspace
::
get_space_list
(
mdtype
);
...
@@ -2551,38 +2551,38 @@ size_t MetaspaceAux::free_bytes() {
...
@@ -2551,38 +2551,38 @@ size_t MetaspaceAux::free_bytes() {
void
MetaspaceAux
::
dec_capacity
(
Metaspace
::
MetadataType
mdtype
,
size_t
words
)
{
void
MetaspaceAux
::
dec_capacity
(
Metaspace
::
MetadataType
mdtype
,
size_t
words
)
{
assert_lock_strong
(
SpaceManager
::
expand_lock
());
assert_lock_strong
(
SpaceManager
::
expand_lock
());
assert
(
words
<=
allocated_
capacity_words
(
mdtype
),
assert
(
words
<=
capacity_words
(
mdtype
),
err_msg
(
"About to decrement below 0: words "
SIZE_FORMAT
err_msg
(
"About to decrement below 0: words "
SIZE_FORMAT
" is greater than _
allocated_
capacity_words[%u] "
SIZE_FORMAT
,
" is greater than _capacity_words[%u] "
SIZE_FORMAT
,
words
,
mdtype
,
allocated_
capacity_words
(
mdtype
)));
words
,
mdtype
,
capacity_words
(
mdtype
)));
_
allocated_
capacity_words
[
mdtype
]
-=
words
;
_capacity_words
[
mdtype
]
-=
words
;
}
}
void
MetaspaceAux
::
inc_capacity
(
Metaspace
::
MetadataType
mdtype
,
size_t
words
)
{
void
MetaspaceAux
::
inc_capacity
(
Metaspace
::
MetadataType
mdtype
,
size_t
words
)
{
assert_lock_strong
(
SpaceManager
::
expand_lock
());
assert_lock_strong
(
SpaceManager
::
expand_lock
());
// Needs to be atomic
// Needs to be atomic
_
allocated_
capacity_words
[
mdtype
]
+=
words
;
_capacity_words
[
mdtype
]
+=
words
;
}
}
void
MetaspaceAux
::
dec_used
(
Metaspace
::
MetadataType
mdtype
,
size_t
words
)
{
void
MetaspaceAux
::
dec_used
(
Metaspace
::
MetadataType
mdtype
,
size_t
words
)
{
assert
(
words
<=
allocated_
used_words
(
mdtype
),
assert
(
words
<=
used_words
(
mdtype
),
err_msg
(
"About to decrement below 0: words "
SIZE_FORMAT
err_msg
(
"About to decrement below 0: words "
SIZE_FORMAT
" is greater than _
allocated_
used_words[%u] "
SIZE_FORMAT
,
" is greater than _used_words[%u] "
SIZE_FORMAT
,
words
,
mdtype
,
allocated_
used_words
(
mdtype
)));
words
,
mdtype
,
used_words
(
mdtype
)));
// For CMS deallocation of the Metaspaces occurs during the
// For CMS deallocation of the Metaspaces occurs during the
// sweep which is a concurrent phase. Protection by the expand_lock()
// sweep which is a concurrent phase. Protection by the expand_lock()
// is not enough since allocation is on a per Metaspace basis
// is not enough since allocation is on a per Metaspace basis
// and protected by the Metaspace lock.
// and protected by the Metaspace lock.
jlong
minus_words
=
(
jlong
)
-
(
jlong
)
words
;
jlong
minus_words
=
(
jlong
)
-
(
jlong
)
words
;
Atomic
::
add_ptr
(
minus_words
,
&
_
allocated_
used_words
[
mdtype
]);
Atomic
::
add_ptr
(
minus_words
,
&
_used_words
[
mdtype
]);
}
}
void
MetaspaceAux
::
inc_used
(
Metaspace
::
MetadataType
mdtype
,
size_t
words
)
{
void
MetaspaceAux
::
inc_used
(
Metaspace
::
MetadataType
mdtype
,
size_t
words
)
{
// _
allocated_
used_words tracks allocations for
// _used_words tracks allocations for
// each piece of metadata. Those allocations are
// each piece of metadata. Those allocations are
// generally done concurrently by different application
// generally done concurrently by different application
// threads so must be done atomically.
// threads so must be done atomically.
Atomic
::
add_ptr
(
words
,
&
_
allocated_
used_words
[
mdtype
]);
Atomic
::
add_ptr
(
words
,
&
_used_words
[
mdtype
]);
}
}
size_t
MetaspaceAux
::
used_bytes_slow
(
Metaspace
::
MetadataType
mdtype
)
{
size_t
MetaspaceAux
::
used_bytes_slow
(
Metaspace
::
MetadataType
mdtype
)
{
...
@@ -2629,16 +2629,16 @@ size_t MetaspaceAux::capacity_bytes_slow(Metaspace::MetadataType mdtype) {
...
@@ -2629,16 +2629,16 @@ size_t MetaspaceAux::capacity_bytes_slow(Metaspace::MetadataType mdtype) {
size_t
MetaspaceAux
::
capacity_bytes_slow
()
{
size_t
MetaspaceAux
::
capacity_bytes_slow
()
{
#ifdef PRODUCT
#ifdef PRODUCT
// Use
allocated_
capacity_bytes() in PRODUCT instead of this function.
// Use capacity_bytes() in PRODUCT instead of this function.
guarantee
(
false
,
"Should not call capacity_bytes_slow() in the PRODUCT"
);
guarantee
(
false
,
"Should not call capacity_bytes_slow() in the PRODUCT"
);
#endif
#endif
size_t
class_capacity
=
capacity_bytes_slow
(
Metaspace
::
ClassType
);
size_t
class_capacity
=
capacity_bytes_slow
(
Metaspace
::
ClassType
);
size_t
non_class_capacity
=
capacity_bytes_slow
(
Metaspace
::
NonClassType
);
size_t
non_class_capacity
=
capacity_bytes_slow
(
Metaspace
::
NonClassType
);
assert
(
allocated_
capacity_bytes
()
==
class_capacity
+
non_class_capacity
,
assert
(
capacity_bytes
()
==
class_capacity
+
non_class_capacity
,
err_msg
(
"bad accounting:
allocated_
capacity_bytes() "
SIZE_FORMAT
err_msg
(
"bad accounting: capacity_bytes() "
SIZE_FORMAT
" class_capacity + non_class_capacity "
SIZE_FORMAT
" class_capacity + non_class_capacity "
SIZE_FORMAT
" class_capacity "
SIZE_FORMAT
" non_class_capacity "
SIZE_FORMAT
,
" class_capacity "
SIZE_FORMAT
" non_class_capacity "
SIZE_FORMAT
,
allocated_
capacity_bytes
(),
class_capacity
+
non_class_capacity
,
capacity_bytes
(),
class_capacity
+
non_class_capacity
,
class_capacity
,
non_class_capacity
));
class_capacity
,
non_class_capacity
));
return
class_capacity
+
non_class_capacity
;
return
class_capacity
+
non_class_capacity
;
...
@@ -2698,14 +2698,14 @@ void MetaspaceAux::print_metaspace_change(size_t prev_metadata_used) {
...
@@ -2698,14 +2698,14 @@ void MetaspaceAux::print_metaspace_change(size_t prev_metadata_used) {
"->"
SIZE_FORMAT
"->"
SIZE_FORMAT
"("
SIZE_FORMAT
")"
,
"("
SIZE_FORMAT
")"
,
prev_metadata_used
,
prev_metadata_used
,
allocated_
used_bytes
(),
used_bytes
(),
reserved_bytes
());
reserved_bytes
());
}
else
{
}
else
{
gclog_or_tty
->
print
(
" "
SIZE_FORMAT
"K"
gclog_or_tty
->
print
(
" "
SIZE_FORMAT
"K"
"->"
SIZE_FORMAT
"K"
"->"
SIZE_FORMAT
"K"
"("
SIZE_FORMAT
"K)"
,
"("
SIZE_FORMAT
"K)"
,
prev_metadata_used
/
K
,
prev_metadata_used
/
K
,
allocated_
used_bytes
()
/
K
,
used_bytes
()
/
K
,
reserved_bytes
()
/
K
);
reserved_bytes
()
/
K
);
}
}
...
@@ -2721,8 +2721,8 @@ void MetaspaceAux::print_on(outputStream* out) {
...
@@ -2721,8 +2721,8 @@ void MetaspaceAux::print_on(outputStream* out) {
"capacity "
SIZE_FORMAT
"K, "
"capacity "
SIZE_FORMAT
"K, "
"committed "
SIZE_FORMAT
"K, "
"committed "
SIZE_FORMAT
"K, "
"reserved "
SIZE_FORMAT
"K"
,
"reserved "
SIZE_FORMAT
"K"
,
allocated_
used_bytes
()
/
K
,
used_bytes
()
/
K
,
allocated_
capacity_bytes
()
/
K
,
capacity_bytes
()
/
K
,
committed_bytes
()
/
K
,
committed_bytes
()
/
K
,
reserved_bytes
()
/
K
);
reserved_bytes
()
/
K
);
...
@@ -2733,8 +2733,8 @@ void MetaspaceAux::print_on(outputStream* out) {
...
@@ -2733,8 +2733,8 @@ void MetaspaceAux::print_on(outputStream* out) {
"capacity "
SIZE_FORMAT
"K, "
"capacity "
SIZE_FORMAT
"K, "
"committed "
SIZE_FORMAT
"K, "
"committed "
SIZE_FORMAT
"K, "
"reserved "
SIZE_FORMAT
"K"
,
"reserved "
SIZE_FORMAT
"K"
,
allocated_
used_bytes
(
ct
)
/
K
,
used_bytes
(
ct
)
/
K
,
allocated_
capacity_bytes
(
ct
)
/
K
,
capacity_bytes
(
ct
)
/
K
,
committed_bytes
(
ct
)
/
K
,
committed_bytes
(
ct
)
/
K
,
reserved_bytes
(
ct
)
/
K
);
reserved_bytes
(
ct
)
/
K
);
}
}
...
@@ -2836,42 +2836,42 @@ void MetaspaceAux::verify_free_chunks() {
...
@@ -2836,42 +2836,42 @@ void MetaspaceAux::verify_free_chunks() {
void
MetaspaceAux
::
verify_capacity
()
{
void
MetaspaceAux
::
verify_capacity
()
{
#ifdef ASSERT
#ifdef ASSERT
size_t
running_sum_capacity_bytes
=
allocated_
capacity_bytes
();
size_t
running_sum_capacity_bytes
=
capacity_bytes
();
// For purposes of the running sum of capacity, verify against capacity
// For purposes of the running sum of capacity, verify against capacity
size_t
capacity_in_use_bytes
=
capacity_bytes_slow
();
size_t
capacity_in_use_bytes
=
capacity_bytes_slow
();
assert
(
running_sum_capacity_bytes
==
capacity_in_use_bytes
,
assert
(
running_sum_capacity_bytes
==
capacity_in_use_bytes
,
err_msg
(
"
allocated_
capacity_words() * BytesPerWord "
SIZE_FORMAT
err_msg
(
"capacity_words() * BytesPerWord "
SIZE_FORMAT
" capacity_bytes_slow()"
SIZE_FORMAT
,
" capacity_bytes_slow()"
SIZE_FORMAT
,
running_sum_capacity_bytes
,
capacity_in_use_bytes
));
running_sum_capacity_bytes
,
capacity_in_use_bytes
));
for
(
Metaspace
::
MetadataType
i
=
Metaspace
::
ClassType
;
for
(
Metaspace
::
MetadataType
i
=
Metaspace
::
ClassType
;
i
<
Metaspace
::
MetadataTypeCount
;
i
<
Metaspace
::
MetadataTypeCount
;
i
=
(
Metaspace
::
MetadataType
)(
i
+
1
))
{
i
=
(
Metaspace
::
MetadataType
)(
i
+
1
))
{
size_t
capacity_in_use_bytes
=
capacity_bytes_slow
(
i
);
size_t
capacity_in_use_bytes
=
capacity_bytes_slow
(
i
);
assert
(
allocated_
capacity_bytes
(
i
)
==
capacity_in_use_bytes
,
assert
(
capacity_bytes
(
i
)
==
capacity_in_use_bytes
,
err_msg
(
"
allocated_
capacity_bytes(%u) "
SIZE_FORMAT
err_msg
(
"capacity_bytes(%u) "
SIZE_FORMAT
" capacity_bytes_slow(%u)"
SIZE_FORMAT
,
" capacity_bytes_slow(%u)"
SIZE_FORMAT
,
i
,
allocated_
capacity_bytes
(
i
),
i
,
capacity_in_use_bytes
));
i
,
capacity_bytes
(
i
),
i
,
capacity_in_use_bytes
));
}
}
#endif
#endif
}
}
void
MetaspaceAux
::
verify_used
()
{
void
MetaspaceAux
::
verify_used
()
{
#ifdef ASSERT
#ifdef ASSERT
size_t
running_sum_used_bytes
=
allocated_
used_bytes
();
size_t
running_sum_used_bytes
=
used_bytes
();
// For purposes of the running sum of used, verify against used
// For purposes of the running sum of used, verify against used
size_t
used_in_use_bytes
=
used_bytes_slow
();
size_t
used_in_use_bytes
=
used_bytes_slow
();
assert
(
allocated_
used_bytes
()
==
used_in_use_bytes
,
assert
(
used_bytes
()
==
used_in_use_bytes
,
err_msg
(
"
allocated_
used_bytes() "
SIZE_FORMAT
err_msg
(
"used_bytes() "
SIZE_FORMAT
" used_bytes_slow()"
SIZE_FORMAT
,
" used_bytes_slow()"
SIZE_FORMAT
,
allocated_
used_bytes
(),
used_in_use_bytes
));
used_bytes
(),
used_in_use_bytes
));
for
(
Metaspace
::
MetadataType
i
=
Metaspace
::
ClassType
;
for
(
Metaspace
::
MetadataType
i
=
Metaspace
::
ClassType
;
i
<
Metaspace
::
MetadataTypeCount
;
i
<
Metaspace
::
MetadataTypeCount
;
i
=
(
Metaspace
::
MetadataType
)(
i
+
1
))
{
i
=
(
Metaspace
::
MetadataType
)(
i
+
1
))
{
size_t
used_in_use_bytes
=
used_bytes_slow
(
i
);
size_t
used_in_use_bytes
=
used_bytes_slow
(
i
);
assert
(
allocated_
used_bytes
(
i
)
==
used_in_use_bytes
,
assert
(
used_bytes
(
i
)
==
used_in_use_bytes
,
err_msg
(
"
allocated_
used_bytes(%u) "
SIZE_FORMAT
err_msg
(
"used_bytes(%u) "
SIZE_FORMAT
" used_bytes_slow(%u)"
SIZE_FORMAT
,
" used_bytes_slow(%u)"
SIZE_FORMAT
,
i
,
allocated_
used_bytes
(
i
),
i
,
used_in_use_bytes
));
i
,
used_bytes
(
i
),
i
,
used_in_use_bytes
));
}
}
#endif
#endif
}
}
...
...
src/share/vm/memory/metaspace.hpp
浏览文件 @
e7fb36ac
...
@@ -280,11 +280,11 @@ class MetaspaceAux : AllStatic {
...
@@ -280,11 +280,11 @@ class MetaspaceAux : AllStatic {
// allocated to a Metaspace. This is used instead of
// allocated to a Metaspace. This is used instead of
// iterating over all the classloaders. One for each
// iterating over all the classloaders. One for each
// type of Metadata
// type of Metadata
static
size_t
_
allocated_
capacity_words
[
Metaspace
::
MetadataTypeCount
];
static
size_t
_capacity_words
[
Metaspace
::
MetadataTypeCount
];
// Running sum of space in all Metachunks that
have
// Running sum of space in all Metachunks that
// are being used for metadata. One for each
// are being used for metadata. One for each
// type of Metadata.
// type of Metadata.
static
size_t
_
allocated_
used_words
[
Metaspace
::
MetadataTypeCount
];
static
size_t
_used_words
[
Metaspace
::
MetadataTypeCount
];
public:
public:
// Decrement and increment _allocated_capacity_words
// Decrement and increment _allocated_capacity_words
...
@@ -308,32 +308,32 @@ class MetaspaceAux : AllStatic {
...
@@ -308,32 +308,32 @@ class MetaspaceAux : AllStatic {
static
size_t
free_chunks_total_bytes
();
static
size_t
free_chunks_total_bytes
();
static
size_t
free_chunks_total_bytes
(
Metaspace
::
MetadataType
mdtype
);
static
size_t
free_chunks_total_bytes
(
Metaspace
::
MetadataType
mdtype
);
static
size_t
allocated_
capacity_words
(
Metaspace
::
MetadataType
mdtype
)
{
static
size_t
capacity_words
(
Metaspace
::
MetadataType
mdtype
)
{
return
_
allocated_
capacity_words
[
mdtype
];
return
_capacity_words
[
mdtype
];
}
}
static
size_t
allocated_
capacity_words
()
{
static
size_t
capacity_words
()
{
return
allocated_
capacity_words
(
Metaspace
::
NonClassType
)
+
return
capacity_words
(
Metaspace
::
NonClassType
)
+
allocated_
capacity_words
(
Metaspace
::
ClassType
);
capacity_words
(
Metaspace
::
ClassType
);
}
}
static
size_t
allocated_
capacity_bytes
(
Metaspace
::
MetadataType
mdtype
)
{
static
size_t
capacity_bytes
(
Metaspace
::
MetadataType
mdtype
)
{
return
allocated_
capacity_words
(
mdtype
)
*
BytesPerWord
;
return
capacity_words
(
mdtype
)
*
BytesPerWord
;
}
}
static
size_t
allocated_
capacity_bytes
()
{
static
size_t
capacity_bytes
()
{
return
allocated_
capacity_words
()
*
BytesPerWord
;
return
capacity_words
()
*
BytesPerWord
;
}
}
static
size_t
allocated_
used_words
(
Metaspace
::
MetadataType
mdtype
)
{
static
size_t
used_words
(
Metaspace
::
MetadataType
mdtype
)
{
return
_
allocated_
used_words
[
mdtype
];
return
_used_words
[
mdtype
];
}
}
static
size_t
allocated_
used_words
()
{
static
size_t
used_words
()
{
return
allocated_
used_words
(
Metaspace
::
NonClassType
)
+
return
used_words
(
Metaspace
::
NonClassType
)
+
allocated_
used_words
(
Metaspace
::
ClassType
);
used_words
(
Metaspace
::
ClassType
);
}
}
static
size_t
allocated_
used_bytes
(
Metaspace
::
MetadataType
mdtype
)
{
static
size_t
used_bytes
(
Metaspace
::
MetadataType
mdtype
)
{
return
allocated_
used_words
(
mdtype
)
*
BytesPerWord
;
return
used_words
(
mdtype
)
*
BytesPerWord
;
}
}
static
size_t
allocated_
used_bytes
()
{
static
size_t
used_bytes
()
{
return
allocated_
used_words
()
*
BytesPerWord
;
return
used_words
()
*
BytesPerWord
;
}
}
static
size_t
free_bytes
();
static
size_t
free_bytes
();
...
...
src/share/vm/memory/metaspaceCounters.cpp
浏览文件 @
e7fb36ac
...
@@ -66,7 +66,7 @@ class MetaspacePerfCounters: public CHeapObj<mtInternal> {
...
@@ -66,7 +66,7 @@ class MetaspacePerfCounters: public CHeapObj<mtInternal> {
MetaspacePerfCounters
*
MetaspaceCounters
::
_perf_counters
=
NULL
;
MetaspacePerfCounters
*
MetaspaceCounters
::
_perf_counters
=
NULL
;
size_t
MetaspaceCounters
::
used
()
{
size_t
MetaspaceCounters
::
used
()
{
return
MetaspaceAux
::
allocated_
used_bytes
();
return
MetaspaceAux
::
used_bytes
();
}
}
size_t
MetaspaceCounters
::
capacity
()
{
size_t
MetaspaceCounters
::
capacity
()
{
...
@@ -98,7 +98,7 @@ void MetaspaceCounters::update_performance_counters() {
...
@@ -98,7 +98,7 @@ void MetaspaceCounters::update_performance_counters() {
MetaspacePerfCounters
*
CompressedClassSpaceCounters
::
_perf_counters
=
NULL
;
MetaspacePerfCounters
*
CompressedClassSpaceCounters
::
_perf_counters
=
NULL
;
size_t
CompressedClassSpaceCounters
::
used
()
{
size_t
CompressedClassSpaceCounters
::
used
()
{
return
MetaspaceAux
::
allocated_
used_bytes
(
Metaspace
::
ClassType
);
return
MetaspaceAux
::
used_bytes
(
Metaspace
::
ClassType
);
}
}
size_t
CompressedClassSpaceCounters
::
capacity
()
{
size_t
CompressedClassSpaceCounters
::
capacity
()
{
...
...
src/share/vm/services/memoryPool.cpp
浏览文件 @
e7fb36ac
...
@@ -268,7 +268,7 @@ MemoryUsage MetaspacePool::get_memory_usage() {
...
@@ -268,7 +268,7 @@ MemoryUsage MetaspacePool::get_memory_usage() {
}
}
size_t
MetaspacePool
::
used_in_bytes
()
{
size_t
MetaspacePool
::
used_in_bytes
()
{
return
MetaspaceAux
::
allocated_
used_bytes
();
return
MetaspaceAux
::
used_bytes
();
}
}
size_t
MetaspacePool
::
calculate_max_size
()
const
{
size_t
MetaspacePool
::
calculate_max_size
()
const
{
...
@@ -280,7 +280,7 @@ CompressedKlassSpacePool::CompressedKlassSpacePool() :
...
@@ -280,7 +280,7 @@ CompressedKlassSpacePool::CompressedKlassSpacePool() :
MemoryPool
(
"Compressed Class Space"
,
NonHeap
,
0
,
CompressedClassSpaceSize
,
true
,
false
)
{
}
MemoryPool
(
"Compressed Class Space"
,
NonHeap
,
0
,
CompressedClassSpaceSize
,
true
,
false
)
{
}
size_t
CompressedKlassSpacePool
::
used_in_bytes
()
{
size_t
CompressedKlassSpacePool
::
used_in_bytes
()
{
return
MetaspaceAux
::
allocated_
used_bytes
(
Metaspace
::
ClassType
);
return
MetaspaceAux
::
used_bytes
(
Metaspace
::
ClassType
);
}
}
MemoryUsage
CompressedKlassSpacePool
::
get_memory_usage
()
{
MemoryUsage
CompressedKlassSpacePool
::
get_memory_usage
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录