Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
b81066f5
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看板
提交
b81066f5
编写于
3月 21, 2014
作者:
E
ehelin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8036699: Add trace event when a metaspace allocation fails
Reviewed-by: jmasa, stefank
上级
ed106049
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
73 addition
and
0 deletion
+73
-0
src/share/vm/memory/metaspace.cpp
src/share/vm/memory/metaspace.cpp
+12
-0
src/share/vm/memory/metaspace.hpp
src/share/vm/memory/metaspace.hpp
+2
-0
src/share/vm/memory/metaspaceTracer.cpp
src/share/vm/memory/metaspaceTracer.cpp
+26
-0
src/share/vm/memory/metaspaceTracer.hpp
src/share/vm/memory/metaspaceTracer.hpp
+7
-0
src/share/vm/trace/trace.xml
src/share/vm/trace/trace.xml
+8
-0
src/share/vm/trace/tracetypes.xml
src/share/vm/trace/tracetypes.xml
+18
-0
未找到文件。
src/share/vm/memory/metaspace.cpp
浏览文件 @
b81066f5
...
...
@@ -3357,6 +3357,8 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size,
MetaWord
*
result
=
loader_data
->
metaspace_non_null
()
->
allocate
(
word_size
,
mdtype
);
if
(
result
==
NULL
)
{
tracer
()
->
report_metaspace_allocation_failure
(
loader_data
,
word_size
,
type
,
mdtype
);
// Allocation failed.
if
(
is_init_completed
())
{
// Only start a GC if the bootstrapping has completed.
...
...
@@ -3425,6 +3427,16 @@ void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_s
}
}
const
char
*
Metaspace
::
metadata_type_name
(
Metaspace
::
MetadataType
mdtype
)
{
switch
(
mdtype
)
{
case
Metaspace
::
ClassType
:
return
"Class"
;
case
Metaspace
::
NonClassType
:
return
"Metadata"
;
default:
assert
(
false
,
err_msg
(
"Got bad mdtype: %d"
,
(
int
)
mdtype
));
return
NULL
;
}
}
void
Metaspace
::
record_allocation
(
void
*
ptr
,
MetaspaceObj
::
Type
type
,
size_t
word_size
)
{
assert
(
DumpSharedSpaces
,
"sanity"
);
...
...
src/share/vm/memory/metaspace.hpp
浏览文件 @
b81066f5
...
...
@@ -240,6 +240,8 @@ class Metaspace : public CHeapObj<mtClass> {
static
void
report_metadata_oome
(
ClassLoaderData
*
loader_data
,
size_t
word_size
,
MetadataType
mdtype
,
TRAPS
);
static
const
char
*
metadata_type_name
(
Metaspace
::
MetadataType
mdtype
);
void
print_on
(
outputStream
*
st
)
const
;
// Debugging support
void
verify
();
...
...
src/share/vm/memory/metaspaceTracer.cpp
浏览文件 @
b81066f5
...
...
@@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "memory/metaspaceTracer.hpp"
#include "trace/tracing.hpp"
#include "trace/traceBackend.hpp"
...
...
@@ -38,3 +39,28 @@ void MetaspaceTracer::report_gc_threshold(size_t old_val,
event
.
commit
();
}
}
void
MetaspaceTracer
::
report_metaspace_allocation_failure
(
ClassLoaderData
*
cld
,
size_t
word_size
,
MetaspaceObj
::
Type
objtype
,
Metaspace
::
MetadataType
mdtype
)
const
{
EventMetaspaceAllocationFailure
event
;
if
(
event
.
should_commit
())
{
if
(
cld
->
is_anonymous
())
{
event
.
set_classLoader
(
NULL
);
event
.
set_anonymousClassLoader
(
true
);
}
else
{
if
(
cld
->
is_the_null_class_loader_data
())
{
event
.
set_classLoader
((
Klass
*
)
NULL
);
}
else
{
event
.
set_classLoader
(
cld
->
class_loader
()
->
klass
());
}
event
.
set_anonymousClassLoader
(
false
);
}
event
.
set_size
(
word_size
*
BytesPerWord
);
event
.
set_metadataType
((
u1
)
mdtype
);
event
.
set_metaspaceObjectType
((
u1
)
objtype
);
event
.
commit
();
}
}
src/share/vm/memory/metaspaceTracer.hpp
浏览文件 @
b81066f5
...
...
@@ -26,13 +26,20 @@
#define SHARE_VM_MEMORY_METASPACE_TRACER_HPP
#include "memory/allocation.hpp"
#include "memory/metaspace.hpp"
#include "memory/metaspaceGCThresholdUpdater.hpp"
class
ClassLoaderData
;
class
MetaspaceTracer
:
public
CHeapObj
<
mtTracing
>
{
public:
void
report_gc_threshold
(
size_t
old_val
,
size_t
new_val
,
MetaspaceGCThresholdUpdater
::
Type
updater
)
const
;
void
report_metaspace_allocation_failure
(
ClassLoaderData
*
cld
,
size_t
word_size
,
MetaspaceObj
::
Type
objtype
,
Metaspace
::
MetadataType
mdtype
)
const
;
};
#endif // SHARE_VM_MEMORY_METASPACE_TRACER_HPP
src/share/vm/trace/trace.xml
浏览文件 @
b81066f5
...
...
@@ -205,6 +205,14 @@ Declares a structure type that can be used in other events.
<value
type=
"GCTHRESHOLDUPDATER"
field=
"updater"
label=
"Updater"
/>
</event>
<event
id=
"MetaspaceAllocationFailure"
path=
"vm/gc/metaspace/allocation_failure"
label=
"Metaspace Allocation Failure"
is_instant=
"true"
has_stacktrace=
"true"
>
<value
type=
"CLASS"
field=
"classLoader"
label=
"Class Loader"
/>
<value
type=
"BOOLEAN"
field=
"anonymousClassLoader"
label=
"Anonymous Class Loader"
/>
<value
type=
"BYTES64"
field=
"size"
label=
"Size"
/>
<value
type=
"METADATATYPE"
field=
"metadataType"
label=
"Metadata Type"
/>
<value
type=
"METASPACEOBJTYPE"
field=
"metaspaceObjectType"
label=
"Metaspace Object Type"
/>
</event>
<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=
"GCWHEN"
field=
"when"
label=
"When"
/>
...
...
src/share/vm/trace/tracetypes.xml
浏览文件 @
b81066f5
...
...
@@ -140,6 +140,16 @@ Now we can use the content + data type in declaring event fields.
<value
type=
"UTF8"
field=
"type"
label=
"type"
/>
</content_type>
<content_type
id=
"MetadataType"
hr_name=
"Metadata Type"
type=
"U1"
jvm_type=
"METADATATYPE"
>
<value
type=
"UTF8"
field=
"type"
label=
"type"
/>
</content_type>
<content_type
id=
"MetaspaceObjectType"
hr_name=
"Metaspace Object Type"
type=
"U1"
jvm_type=
"METASPACEOBJTYPE"
>
<value
type=
"UTF8"
field=
"type"
label=
"type"
/>
</content_type>
<content_type
id=
"NARROW_OOP_MODE"
hr_name=
"Narrow Oop Mode"
type=
"U1"
jvm_type=
"NARROWOOPMODE"
>
<value
type=
"UTF8"
field=
"mode"
label=
"mode"
/>
...
...
@@ -337,6 +347,14 @@ Now we can use the content + data type in declaring event fields.
<primary_type
symbol=
"REFERENCETYPE"
datatype=
"U1"
contenttype=
"REFERENCETYPE"
type=
"u1"
sizeop=
"sizeof(u1)"
/>
<!-- METADATATYPE -->
<primary_type
symbol=
"METADATATYPE"
datatype=
"U1"
contenttype=
"METADATATYPE"
type=
"u1"
sizeop=
"sizeof(u1)"
/>
<!-- METADATAOBJTYPE -->
<primary_type
symbol=
"METASPACEOBJTYPE"
datatype=
"U1"
contenttype=
"METASPACEOBJTYPE"
type=
"u1"
sizeop=
"sizeof(u1)"
/>
<!-- NARROWOOPMODE -->
<primary_type
symbol=
"NARROWOOPMODE"
datatype=
"U1"
contenttype=
"NARROWOOPMODE"
type=
"u1"
sizeop=
"sizeof(u1)"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录