Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
bdf28cda
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看板
提交
bdf28cda
编写于
3月 04, 2013
作者:
E
ehelin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8004172: Update jstat counter names to reflect metaspace changes
Reviewed-by: stefank, jmasa
上级
708c714d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
75 deletion
+34
-75
src/share/vm/memory/metaspaceCounters.cpp
src/share/vm/memory/metaspaceCounters.cpp
+34
-73
src/share/vm/memory/metaspaceCounters.hpp
src/share/vm/memory/metaspaceCounters.hpp
+0
-2
未找到文件。
src/share/vm/memory/metaspaceCounters.cpp
浏览文件 @
bdf28cda
...
...
@@ -25,12 +25,14 @@
#include "precompiled.hpp"
#include "memory/metaspaceCounters.hpp"
#include "memory/resourceArea.hpp"
#define METASPACE_NAME "perm"
#include "utilities/exceptions.hpp"
MetaspaceCounters
*
MetaspaceCounters
::
_metaspace_counters
=
NULL
;
MetaspaceCounters
::
MetaspaceCounters
()
{
MetaspaceCounters
::
MetaspaceCounters
()
:
_capacity
(
NULL
),
_used
(
NULL
),
_max_capacity
(
NULL
)
{
if
(
UsePerfData
)
{
size_t
min_capacity
=
MetaspaceAux
::
min_chunk_size
();
size_t
max_capacity
=
MetaspaceAux
::
reserved_in_bytes
();
...
...
@@ -41,6 +43,25 @@ MetaspaceCounters::MetaspaceCounters() {
}
}
static
PerfVariable
*
create_ms_variable
(
const
char
*
ns
,
const
char
*
name
,
size_t
value
,
TRAPS
)
{
const
char
*
path
=
PerfDataManager
::
counter_name
(
ns
,
name
);
PerfVariable
*
result
=
PerfDataManager
::
create_variable
(
SUN_GC
,
path
,
PerfData
::
U_Bytes
,
value
,
CHECK_NULL
);
return
result
;
}
static
void
create_ms_constant
(
const
char
*
ns
,
const
char
*
name
,
size_t
value
,
TRAPS
)
{
const
char
*
path
=
PerfDataManager
::
counter_name
(
ns
,
name
);
PerfDataManager
::
create_constant
(
SUN_GC
,
path
,
PerfData
::
U_Bytes
,
value
,
CHECK
);
}
void
MetaspaceCounters
::
initialize
(
size_t
min_capacity
,
size_t
max_capacity
,
size_t
curr_capacity
,
...
...
@@ -50,93 +71,32 @@ void MetaspaceCounters::initialize(size_t min_capacity,
EXCEPTION_MARK
;
ResourceMark
rm
;
// Create a name that will be recognized by jstat tools as
// the perm gen. Change this to a Metaspace name when the
// tools are fixed.
// name to recognize "sun.gc.generation.2.*"
const
char
*
name
=
METASPACE_NAME
;
const
int
ordinal
=
2
;
const
int
spaces
=
1
;
const
char
*
cns
=
PerfDataManager
::
name_space
(
"generation"
,
ordinal
);
_name_space
=
NEW_C_HEAP_ARRAY
(
char
,
strlen
(
cns
)
+
1
,
mtClass
);
strcpy
(
_name_space
,
cns
);
const
char
*
cname
=
PerfDataManager
::
counter_name
(
_name_space
,
"name"
);
PerfDataManager
::
create_string_constant
(
SUN_GC
,
cname
,
name
,
CHECK
);
// End of perm gen like name creation
cname
=
PerfDataManager
::
counter_name
(
_name_space
,
"spaces"
);
PerfDataManager
::
create_constant
(
SUN_GC
,
cname
,
PerfData
::
U_None
,
spaces
,
CHECK
);
cname
=
PerfDataManager
::
counter_name
(
_name_space
,
"minCapacity"
);
PerfDataManager
::
create_constant
(
SUN_GC
,
cname
,
PerfData
::
U_Bytes
,
min_capacity
,
CHECK
);
cname
=
PerfDataManager
::
counter_name
(
_name_space
,
"maxCapacity"
);
PerfDataManager
::
create_constant
(
SUN_GC
,
cname
,
PerfData
::
U_Bytes
,
max_capacity
,
CHECK
);
cname
=
PerfDataManager
::
counter_name
(
_name_space
,
"capacity"
);
_current_size
=
PerfDataManager
::
create_variable
(
SUN_GC
,
cname
,
PerfData
::
U_Bytes
,
curr_capacity
,
CHECK
);
// SpaceCounter like counters
// name to recognize "sun.gc.generation.2.space.0.*"
{
const
int
space_ordinal
=
0
;
const
char
*
cns
=
PerfDataManager
::
name_space
(
_name_space
,
"space"
,
space_ordinal
);
char
*
space_name_space
=
NEW_C_HEAP_ARRAY
(
char
,
strlen
(
cns
)
+
1
,
mtClass
);
strcpy
(
space_name_space
,
cns
);
const
char
*
cname
=
PerfDataManager
::
counter_name
(
space_name_space
,
"name"
);
PerfDataManager
::
create_string_constant
(
SUN_GC
,
cname
,
name
,
CHECK
);
cname
=
PerfDataManager
::
counter_name
(
space_name_space
,
"maxCapacity"
);
_max_capacity
=
PerfDataManager
::
create_variable
(
SUN_GC
,
cname
,
PerfData
::
U_Bytes
,
(
jlong
)
max_capacity
,
CHECK
);
cname
=
PerfDataManager
::
counter_name
(
space_name_space
,
"capacity"
);
_capacity
=
PerfDataManager
::
create_variable
(
SUN_GC
,
cname
,
PerfData
::
U_Bytes
,
curr_capacity
,
CHECK
);
cname
=
PerfDataManager
::
counter_name
(
space_name_space
,
"used"
);
_used
=
PerfDataManager
::
create_variable
(
SUN_GC
,
cname
,
PerfData
::
U_Bytes
,
used
,
CHECK
);
const
char
*
ms
=
"metaspace"
;
c
name
=
PerfDataManager
::
counter_name
(
space_name_space
,
"initCapacity"
);
PerfDataManager
::
create_constant
(
SUN_GC
,
cname
,
PerfData
::
U_Bytes
,
min
_capacity
,
CHECK
);
}
c
reate_ms_constant
(
ms
,
"minCapacity"
,
min_capacity
,
CHECK
);
_max_capacity
=
create_ms_variable
(
ms
,
"maxCapacity"
,
max_capacity
,
CHECK
);
_capacity
=
create_ms_variable
(
ms
,
"capacity"
,
curr
_capacity
,
CHECK
);
_used
=
create_ms_variable
(
ms
,
"used"
,
used
,
CHECK
);
}
}
void
MetaspaceCounters
::
update_capacity
()
{
assert
(
UsePerfData
,
"Should not be called unless being used"
);
assert
(
_capacity
!=
NULL
,
"Should be initialized"
);
size_t
capacity_in_bytes
=
MetaspaceAux
::
capacity_in_bytes
();
_capacity
->
set_value
(
capacity_in_bytes
);
}
void
MetaspaceCounters
::
update_used
()
{
assert
(
UsePerfData
,
"Should not be called unless being used"
);
assert
(
_used
!=
NULL
,
"Should be initialized"
);
size_t
used_in_bytes
=
MetaspaceAux
::
used_in_bytes
();
_used
->
set_value
(
used_in_bytes
);
}
void
MetaspaceCounters
::
update_max_capacity
()
{
assert
(
UsePerfData
,
"Should not be called unless being used"
);
assert
(
_max_capacity
!=
NULL
,
"Should be initialized"
);
size_t
reserved_in_bytes
=
MetaspaceAux
::
reserved_in_bytes
();
_max_capacity
->
set_value
(
reserved_in_bytes
);
}
...
...
@@ -146,18 +106,19 @@ void MetaspaceCounters::update_all() {
update_used
();
update_capacity
();
update_max_capacity
();
_current_size
->
set_value
(
MetaspaceAux
::
reserved_in_bytes
());
}
}
void
MetaspaceCounters
::
initialize_performance_counters
()
{
if
(
UsePerfData
)
{
assert
(
_metaspace_counters
==
NULL
,
"Should only be initialized once"
);
_metaspace_counters
=
new
MetaspaceCounters
();
}
}
void
MetaspaceCounters
::
update_performance_counters
()
{
if
(
UsePerfData
)
{
assert
(
_metaspace_counters
!=
NULL
,
"Should be initialized"
);
_metaspace_counters
->
update_all
();
}
}
...
...
src/share/vm/memory/metaspaceCounters.hpp
浏览文件 @
bdf28cda
...
...
@@ -29,11 +29,9 @@
class
MetaspaceCounters
:
public
CHeapObj
<
mtClass
>
{
friend
class
VMStructs
;
PerfVariable
*
_current_size
;
PerfVariable
*
_capacity
;
PerfVariable
*
_used
;
PerfVariable
*
_max_capacity
;
char
*
_name_space
;
static
MetaspaceCounters
*
_metaspace_counters
;
void
initialize
(
size_t
min_capacity
,
size_t
max_capacity
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录