Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
ab5307ee
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看板
提交
ab5307ee
编写于
1月 23, 2013
作者:
J
jmasa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8005452: NPG: Create new flags for Metaspace resizing policy
Reviewed-by: johnc, jwilhelm, coleenp, stefank
上级
8c793d0e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
7 deletion
+31
-7
src/share/vm/memory/metaspace.cpp
src/share/vm/memory/metaspace.cpp
+5
-5
src/share/vm/runtime/arguments.cpp
src/share/vm/runtime/arguments.cpp
+18
-0
src/share/vm/runtime/globals.hpp
src/share/vm/runtime/globals.hpp
+8
-2
未找到文件。
src/share/vm/memory/metaspace.cpp
浏览文件 @
ab5307ee
...
...
@@ -1064,11 +1064,11 @@ bool VirtualSpaceList::contains(const void *ptr) {
//
// After the GC the compute_new_size() for MetaspaceGC is called to
// resize the capacity of the metaspaces. The current implementation
// is based on the flags Min
Heap
FreeRatio and MaxHeapFreeRatio used
// is based on the flags Min
Metaspace
FreeRatio and MaxHeapFreeRatio used
// to resize the Java heap by some GC's. New flags can be implemented
// if really needed. MinHeapFreeRatio is used to calculate how much
// free space is desirable in the metaspace capacity to decide how much
// to increase the HWM. Max
Heap
FreeRatio is used to decide how much
// to increase the HWM. Max
Metaspace
FreeRatio is used to decide how much
// free space is desirable in the metaspace capacity before decreasing
// the HWM.
...
...
@@ -1166,7 +1166,7 @@ void MetaspaceGC::compute_new_size() {
size_t
capacity_until_GC
=
vsl
->
capacity_bytes_sum
();
size_t
free_after_gc
=
capacity_until_GC
-
used_after_gc
;
const
double
minimum_free_percentage
=
Min
Heap
FreeRatio
/
100.0
;
const
double
minimum_free_percentage
=
Min
Metaspace
FreeRatio
/
100.0
;
const
double
maximum_used_percentage
=
1.0
-
minimum_free_percentage
;
const
double
min_tmp
=
used_after_gc
/
maximum_used_percentage
;
...
...
@@ -1232,8 +1232,8 @@ void MetaspaceGC::compute_new_size() {
max_shrink_words
));
// Should shrinking be considered?
if
(
Max
Heap
FreeRatio
<
100
)
{
const
double
maximum_free_percentage
=
Max
Heap
FreeRatio
/
100.0
;
if
(
Max
Metaspace
FreeRatio
<
100
)
{
const
double
maximum_free_percentage
=
Max
Metaspace
FreeRatio
/
100.0
;
const
double
minimum_used_percentage
=
1.0
-
maximum_free_percentage
;
const
double
max_tmp
=
used_after_gc
/
minimum_used_percentage
;
size_t
maximum_desired_capacity
=
(
size_t
)
MIN2
(
max_tmp
,
double
(
max_uintx
));
...
...
src/share/vm/runtime/arguments.cpp
浏览文件 @
ab5307ee
...
...
@@ -1896,6 +1896,24 @@ bool Arguments::check_vm_args_consistency() {
// Keeping the heap 100% free is hard ;-) so limit it to 99%.
MinHeapFreeRatio
=
MIN2
(
MinHeapFreeRatio
,
(
uintx
)
99
);
// Min/MaxMetaspaceFreeRatio
status
=
status
&&
verify_percentage
(
MinMetaspaceFreeRatio
,
"MinMetaspaceFreeRatio"
);
status
=
status
&&
verify_percentage
(
MaxMetaspaceFreeRatio
,
"MaxMetaspaceFreeRatio"
);
if
(
MinMetaspaceFreeRatio
>
MaxMetaspaceFreeRatio
)
{
jio_fprintf
(
defaultStream
::
error_stream
(),
"MinMetaspaceFreeRatio (%s"
UINTX_FORMAT
") must be less than or "
"equal to MaxMetaspaceFreeRatio (%s"
UINTX_FORMAT
")
\n
"
,
FLAG_IS_DEFAULT
(
MinMetaspaceFreeRatio
)
?
"Default: "
:
""
,
MinMetaspaceFreeRatio
,
FLAG_IS_DEFAULT
(
MaxMetaspaceFreeRatio
)
?
"Default: "
:
""
,
MaxMetaspaceFreeRatio
);
status
=
false
;
}
// Trying to keep 100% free is not practical
MinMetaspaceFreeRatio
=
MIN2
(
MinMetaspaceFreeRatio
,
(
uintx
)
99
);
if
(
FullGCALot
&&
FLAG_IS_DEFAULT
(
MarkSweepAlwaysCompactCount
))
{
MarkSweepAlwaysCompactCount
=
1
;
// Move objects every gc.
}
...
...
src/share/vm/runtime/globals.hpp
浏览文件 @
ab5307ee
...
...
@@ -3010,10 +3010,16 @@ class CommandLineFlags {
"Min change in heap space due to GC (in bytes)") \
\
product(uintx, MinMetaspaceExpansion, ScaleForWordSize(256*K), \
"Min expansion of permanent heap (in bytes)") \
"Min expansion of Metaspace (in bytes)") \
\
product(uintx, MinMetaspaceFreeRatio, 40, \
"Min percentage of Metaspace free after GC to avoid expansion") \
\
product(uintx, MaxMetaspaceFreeRatio, 70, \
"Max percentage of Metaspace free after GC to avoid shrinking") \
\
product(uintx, MaxMetaspaceExpansion, ScaleForWordSize(4*M), \
"Max expansion of
permanent heap without full GC (in bytes)")
\
"Max expansion of
Metaspace without full GC (in bytes)")
\
\
product(intx, QueuedAllocationWarningCount, 0, \
"Number of times an allocation that queues behind a GC " \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录