Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
ed106049
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看板
提交
ed106049
编写于
3月 21, 2014
作者:
E
ehelin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8036698: Add trace event for updates to metaspace gc threshold
Reviewed-by: stefank, mgerdin
上级
c148f71d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
177 addition
and
14 deletion
+177
-14
src/share/vm/memory/metaspace.cpp
src/share/vm/memory/metaspace.cpp
+27
-14
src/share/vm/memory/metaspace.hpp
src/share/vm/memory/metaspace.hpp
+5
-0
src/share/vm/memory/metaspaceGCThresholdUpdater.hpp
src/share/vm/memory/metaspaceGCThresholdUpdater.hpp
+52
-0
src/share/vm/memory/metaspaceTracer.cpp
src/share/vm/memory/metaspaceTracer.cpp
+40
-0
src/share/vm/memory/metaspaceTracer.hpp
src/share/vm/memory/metaspaceTracer.hpp
+38
-0
src/share/vm/trace/trace.xml
src/share/vm/trace/trace.xml
+6
-0
src/share/vm/trace/tracetypes.xml
src/share/vm/trace/tracetypes.xml
+9
-0
未找到文件。
src/share/vm/memory/metaspace.cpp
浏览文件 @
ed106049
...
@@ -32,7 +32,9 @@
...
@@ -32,7 +32,9 @@
#include "memory/gcLocker.hpp"
#include "memory/gcLocker.hpp"
#include "memory/metachunk.hpp"
#include "memory/metachunk.hpp"
#include "memory/metaspace.hpp"
#include "memory/metaspace.hpp"
#include "memory/metaspaceGCThresholdUpdater.hpp"
#include "memory/metaspaceShared.hpp"
#include "memory/metaspaceShared.hpp"
#include "memory/metaspaceTracer.hpp"
#include "memory/resourceArea.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "memory/universe.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/atomic.inline.hpp"
...
@@ -57,6 +59,7 @@ size_t const allocation_from_dictionary_limit = 4 * K;
...
@@ -57,6 +59,7 @@ size_t const allocation_from_dictionary_limit = 4 * K;
MetaWord
*
last_allocated
=
0
;
MetaWord
*
last_allocated
=
0
;
size_t
Metaspace
::
_compressed_class_space_size
;
size_t
Metaspace
::
_compressed_class_space_size
;
const
MetaspaceTracer
*
Metaspace
::
_tracer
=
NULL
;
// Used in declarations in SpaceManager and ChunkManager
// Used in declarations in SpaceManager and ChunkManager
enum
ChunkIndex
{
enum
ChunkIndex
{
...
@@ -1436,19 +1439,21 @@ void MetaspaceGC::compute_new_size() {
...
@@ -1436,19 +1439,21 @@ void MetaspaceGC::compute_new_size() {
expand_bytes
=
align_size_up
(
expand_bytes
,
Metaspace
::
commit_alignment
());
expand_bytes
=
align_size_up
(
expand_bytes
,
Metaspace
::
commit_alignment
());
// Don't expand unless it's significant
// Don't expand unless it's significant
if
(
expand_bytes
>=
MinMetaspaceExpansion
)
{
if
(
expand_bytes
>=
MinMetaspaceExpansion
)
{
MetaspaceGC
::
inc_capacity_until_GC
(
expand_bytes
);
size_t
new_capacity_until_GC
=
MetaspaceGC
::
inc_capacity_until_GC
(
expand_bytes
);
}
Metaspace
::
tracer
()
->
report_gc_threshold
(
capacity_until_GC
,
if
(
PrintGCDetails
&&
Verbose
)
{
new_capacity_until_GC
,
size_t
new_capacity_until_GC
=
capacity_until_GC
;
MetaspaceGCThresholdUpdater
::
ComputeNewSize
);
gclog_or_tty
->
print_cr
(
" expanding:"
if
(
PrintGCDetails
&&
Verbose
)
{
" minimum_desired_capacity: %6.1fKB"
gclog_or_tty
->
print_cr
(
" expanding:"
" expand_bytes: %6.1fKB"
" minimum_desired_capacity: %6.1fKB"
" MinMetaspaceExpansion: %6.1fKB"
" expand_bytes: %6.1fKB"
" new metaspace HWM: %6.1fKB"
,
" MinMetaspaceExpansion: %6.1fKB"
minimum_desired_capacity
/
(
double
)
K
,
" new metaspace HWM: %6.1fKB"
,
expand_bytes
/
(
double
)
K
,
minimum_desired_capacity
/
(
double
)
K
,
MinMetaspaceExpansion
/
(
double
)
K
,
expand_bytes
/
(
double
)
K
,
new_capacity_until_GC
/
(
double
)
K
);
MinMetaspaceExpansion
/
(
double
)
K
,
new_capacity_until_GC
/
(
double
)
K
);
}
}
}
return
;
return
;
}
}
...
@@ -1527,7 +1532,10 @@ void MetaspaceGC::compute_new_size() {
...
@@ -1527,7 +1532,10 @@ void MetaspaceGC::compute_new_size() {
// Don't shrink unless it's significant
// Don't shrink unless it's significant
if
(
shrink_bytes
>=
MinMetaspaceExpansion
&&
if
(
shrink_bytes
>=
MinMetaspaceExpansion
&&
((
capacity_until_GC
-
shrink_bytes
)
>=
MetaspaceSize
))
{
((
capacity_until_GC
-
shrink_bytes
)
>=
MetaspaceSize
))
{
MetaspaceGC
::
dec_capacity_until_GC
(
shrink_bytes
);
size_t
new_capacity_until_GC
=
MetaspaceGC
::
dec_capacity_until_GC
(
shrink_bytes
);
Metaspace
::
tracer
()
->
report_gc_threshold
(
capacity_until_GC
,
new_capacity_until_GC
,
MetaspaceGCThresholdUpdater
::
ComputeNewSize
);
}
}
}
}
...
@@ -3131,6 +3139,7 @@ void Metaspace::global_initialize() {
...
@@ -3131,6 +3139,7 @@ void Metaspace::global_initialize() {
}
}
MetaspaceGC
::
initialize
();
MetaspaceGC
::
initialize
();
_tracer
=
new
MetaspaceTracer
();
}
}
Metachunk
*
Metaspace
::
get_initialization_chunk
(
MetadataType
mdtype
,
Metachunk
*
Metaspace
::
get_initialization_chunk
(
MetadataType
mdtype
,
...
@@ -3219,8 +3228,12 @@ MetaWord* Metaspace::expand_and_allocate(size_t word_size, MetadataType mdtype)
...
@@ -3219,8 +3228,12 @@ MetaWord* Metaspace::expand_and_allocate(size_t word_size, MetadataType mdtype)
assert
(
delta_bytes
>
0
,
"Must be"
);
assert
(
delta_bytes
>
0
,
"Must be"
);
size_t
after_inc
=
MetaspaceGC
::
inc_capacity_until_GC
(
delta_bytes
);
size_t
after_inc
=
MetaspaceGC
::
inc_capacity_until_GC
(
delta_bytes
);
// capacity_until_GC might be updated concurrently, must calculate previous value.
size_t
before_inc
=
after_inc
-
delta_bytes
;
size_t
before_inc
=
after_inc
-
delta_bytes
;
tracer
()
->
report_gc_threshold
(
before_inc
,
after_inc
,
MetaspaceGCThresholdUpdater
::
ExpandAndAllocate
);
if
(
PrintGCDetails
&&
Verbose
)
{
if
(
PrintGCDetails
&&
Verbose
)
{
gclog_or_tty
->
print_cr
(
"Increase capacity to GC from "
SIZE_FORMAT
gclog_or_tty
->
print_cr
(
"Increase capacity to GC from "
SIZE_FORMAT
" to "
SIZE_FORMAT
,
before_inc
,
after_inc
);
" to "
SIZE_FORMAT
,
before_inc
,
after_inc
);
...
...
src/share/vm/memory/metaspace.hpp
浏览文件 @
ed106049
...
@@ -60,6 +60,7 @@ class ChunkManager;
...
@@ -60,6 +60,7 @@ class ChunkManager;
class
ClassLoaderData
;
class
ClassLoaderData
;
class
Metablock
;
class
Metablock
;
class
Metachunk
;
class
Metachunk
;
class
MetaspaceTracer
;
class
MetaWord
;
class
MetaWord
;
class
Mutex
;
class
Mutex
;
class
outputStream
;
class
outputStream
;
...
@@ -148,6 +149,8 @@ class Metaspace : public CHeapObj<mtClass> {
...
@@ -148,6 +149,8 @@ class Metaspace : public CHeapObj<mtClass> {
static
ChunkManager
*
_chunk_manager_metadata
;
static
ChunkManager
*
_chunk_manager_metadata
;
static
ChunkManager
*
_chunk_manager_class
;
static
ChunkManager
*
_chunk_manager_class
;
static
const
MetaspaceTracer
*
_tracer
;
public:
public:
static
VirtualSpaceList
*
space_list
()
{
return
_space_list
;
}
static
VirtualSpaceList
*
space_list
()
{
return
_space_list
;
}
static
VirtualSpaceList
*
class_space_list
()
{
return
_class_space_list
;
}
static
VirtualSpaceList
*
class_space_list
()
{
return
_class_space_list
;
}
...
@@ -163,6 +166,8 @@ class Metaspace : public CHeapObj<mtClass> {
...
@@ -163,6 +166,8 @@ class Metaspace : public CHeapObj<mtClass> {
return
mdtype
==
ClassType
?
chunk_manager_class
()
:
chunk_manager_metadata
();
return
mdtype
==
ClassType
?
chunk_manager_class
()
:
chunk_manager_metadata
();
}
}
static
const
MetaspaceTracer
*
tracer
()
{
return
_tracer
;
}
private:
private:
// This is used by DumpSharedSpaces only, where only _vsm is used. So we will
// This is used by DumpSharedSpaces only, where only _vsm is used. So we will
// maintain a single list for now.
// maintain a single list for now.
...
...
src/share/vm/memory/metaspaceGCThresholdUpdater.hpp
0 → 100644
浏览文件 @
ed106049
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_MEMORY_METASPACE_GC_THRESHOLD_UPDATER_HPP
#define SHARE_VM_MEMORY_METASPACE_GC_THRESHOLD_UPDATER_HPP
#include "memory/allocation.hpp"
#include "utilities/debug.hpp"
class
MetaspaceGCThresholdUpdater
:
public
AllStatic
{
public:
enum
Type
{
ComputeNewSize
,
ExpandAndAllocate
,
Last
};
static
const
char
*
to_string
(
MetaspaceGCThresholdUpdater
::
Type
updater
)
{
switch
(
updater
)
{
case
ComputeNewSize
:
return
"compute_new_size"
;
case
ExpandAndAllocate
:
return
"expand_and_allocate"
;
default:
assert
(
false
,
err_msg
(
"Got bad updater: %d"
,
(
int
)
updater
));
return
NULL
;
};
}
};
#endif // SHARE_VM_MEMORY_METASPACE_GC_THRESHOLD_UPDATER_HPP
src/share/vm/memory/metaspaceTracer.cpp
0 → 100644
浏览文件 @
ed106049
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "memory/metaspaceTracer.hpp"
#include "trace/tracing.hpp"
#include "trace/traceBackend.hpp"
void
MetaspaceTracer
::
report_gc_threshold
(
size_t
old_val
,
size_t
new_val
,
MetaspaceGCThresholdUpdater
::
Type
updater
)
const
{
EventMetaspaceGCThreshold
event
;
if
(
event
.
should_commit
())
{
event
.
set_oldValue
(
old_val
);
event
.
set_newValue
(
new_val
);
event
.
set_updater
((
u1
)
updater
);
event
.
commit
();
}
}
src/share/vm/memory/metaspaceTracer.hpp
0 → 100644
浏览文件 @
ed106049
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_MEMORY_METASPACE_TRACER_HPP
#define SHARE_VM_MEMORY_METASPACE_TRACER_HPP
#include "memory/allocation.hpp"
#include "memory/metaspaceGCThresholdUpdater.hpp"
class
MetaspaceTracer
:
public
CHeapObj
<
mtTracing
>
{
public:
void
report_gc_threshold
(
size_t
old_val
,
size_t
new_val
,
MetaspaceGCThresholdUpdater
::
Type
updater
)
const
;
};
#endif // SHARE_VM_MEMORY_METASPACE_TRACER_HPP
src/share/vm/trace/trace.xml
浏览文件 @
ed106049
...
@@ -199,6 +199,12 @@ Declares a structure type that can be used in other events.
...
@@ -199,6 +199,12 @@ Declares a structure type that can be used in other events.
<structvalue
type=
"MetaspaceSizes"
field=
"classSpace"
label=
"Class"
/>
<structvalue
type=
"MetaspaceSizes"
field=
"classSpace"
label=
"Class"
/>
</event>
</event>
<event
id=
"MetaspaceGCThreshold"
path=
"vm/gc/metaspace/gc_threshold"
label=
"Metaspace GC Threshold"
is_instant=
"true"
>
<value
type=
"BYTES64"
field=
"oldValue"
label=
"Old Value"
/>
<value
type=
"BYTES64"
field=
"newValue"
label=
"New Value"
/>
<value
type=
"GCTHRESHOLDUPDATER"
field=
"updater"
label=
"Updater"
/>
</event>
<event
id=
"PSHeapSummary"
path=
"vm/gc/heap/ps_summary"
label=
"Parallel Scavenge Heap Summary"
is_instant=
"true"
>
<event
id=
"PSHeapSummary"
path=
"vm/gc/heap/ps_summary"
label=
"Parallel Scavenge Heap Summary"
is_instant=
"true"
>
<value
type=
"UINT"
field=
"gcId"
label=
"GC ID"
relation=
"GC_ID"
/>
<value
type=
"UINT"
field=
"gcId"
label=
"GC ID"
relation=
"GC_ID"
/>
<value
type=
"GCWHEN"
field=
"when"
label=
"When"
/>
<value
type=
"GCWHEN"
field=
"when"
label=
"When"
/>
...
...
src/share/vm/trace/tracetypes.xml
浏览文件 @
ed106049
...
@@ -130,6 +130,11 @@ Now we can use the content + data type in declaring event fields.
...
@@ -130,6 +130,11 @@ Now we can use the content + data type in declaring event fields.
<value
type=
"UTF8"
field=
"type"
label=
"type"
/>
<value
type=
"UTF8"
field=
"type"
label=
"type"
/>
</content_type>
</content_type>
<content_type
id=
"GCThresholdUpdater"
hr_name=
"GC Treshold Updater"
type=
"U1"
jvm_type=
"GCTHRESHOLDUPDATER"
>
<value
type=
"UTF8"
field=
"updater"
label=
"updater"
/>
</content_type>
<content_type
id=
"ReferenceType"
hr_name=
"Reference Type"
<content_type
id=
"ReferenceType"
hr_name=
"Reference Type"
type=
"U1"
jvm_type=
"REFERENCETYPE"
>
type=
"U1"
jvm_type=
"REFERENCETYPE"
>
<value
type=
"UTF8"
field=
"type"
label=
"type"
/>
<value
type=
"UTF8"
field=
"type"
label=
"type"
/>
...
@@ -324,6 +329,10 @@ Now we can use the content + data type in declaring event fields.
...
@@ -324,6 +329,10 @@ Now we can use the content + data type in declaring event fields.
<primary_type
symbol=
"G1YCTYPE"
datatype=
"U1"
contenttype=
"G1YCTYPE"
<primary_type
symbol=
"G1YCTYPE"
datatype=
"U1"
contenttype=
"G1YCTYPE"
type=
"u1"
sizeop=
"sizeof(u1)"
/>
type=
"u1"
sizeop=
"sizeof(u1)"
/>
<!-- GCTHRESHOLDUPDATER -->
<primary_type
symbol=
"GCTHRESHOLDUPDATER"
datatype=
"U1"
contenttype=
"GCTHRESHOLDUPDATER"
type=
"u1"
sizeop=
"sizeof(u1)"
/>
<!-- REFERENCETYPE -->
<!-- REFERENCETYPE -->
<primary_type
symbol=
"REFERENCETYPE"
datatype=
"U1"
<primary_type
symbol=
"REFERENCETYPE"
datatype=
"U1"
contenttype=
"REFERENCETYPE"
type=
"u1"
sizeop=
"sizeof(u1)"
/>
contenttype=
"REFERENCETYPE"
type=
"u1"
sizeop=
"sizeof(u1)"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录