Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
dcf201eb
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看板
提交
dcf201eb
编写于
3月 02, 2015
作者:
M
mlarsson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8065331: Add trace events for failed allocations
Reviewed-by: ehelin, jwilhelm
上级
9c7225ab
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
43 addition
and
9 deletion
+43
-9
src/share/vm/gc_implementation/shared/vmGCOperations.cpp
src/share/vm/gc_implementation/shared/vmGCOperations.cpp
+20
-0
src/share/vm/gc_implementation/shared/vmGCOperations.hpp
src/share/vm/gc_implementation/shared/vmGCOperations.hpp
+3
-6
src/share/vm/gc_interface/allocTracer.cpp
src/share/vm/gc_interface/allocTracer.cpp
+11
-1
src/share/vm/gc_interface/allocTracer.hpp
src/share/vm/gc_interface/allocTracer.hpp
+2
-1
src/share/vm/trace/trace.xml
src/share/vm/trace/trace.xml
+7
-1
未找到文件。
src/share/vm/gc_implementation/shared/vmGCOperations.cpp
浏览文件 @
dcf201eb
...
...
@@ -209,6 +209,18 @@ void VM_GenCollectFull::doit() {
gch
->
do_full_collection
(
gch
->
must_clear_all_soft_refs
(),
_max_level
);
}
VM_CollectForMetadataAllocation
::
VM_CollectForMetadataAllocation
(
ClassLoaderData
*
loader_data
,
size_t
size
,
Metaspace
::
MetadataType
mdtype
,
uint
gc_count_before
,
uint
full_gc_count_before
,
GCCause
::
Cause
gc_cause
)
:
VM_GC_Operation
(
gc_count_before
,
gc_cause
,
full_gc_count_before
,
true
),
_loader_data
(
loader_data
),
_size
(
size
),
_mdtype
(
mdtype
),
_result
(
NULL
)
{
assert
(
_size
!=
0
,
"An allocation should always be requested with this operation."
);
AllocTracer
::
send_allocation_requiring_gc_event
(
_size
*
HeapWordSize
,
GCId
::
peek
());
}
// Returns true iff concurrent GCs unloads metadata.
bool
VM_CollectForMetadataAllocation
::
initiate_concurrent_GC
()
{
#if INCLUDE_ALL_GCS
...
...
@@ -313,3 +325,11 @@ void VM_CollectForMetadataAllocation::doit() {
set_gc_locked
();
}
}
VM_CollectForAllocation
::
VM_CollectForAllocation
(
size_t
word_size
,
uint
gc_count_before
,
GCCause
::
Cause
cause
)
:
VM_GC_Operation
(
gc_count_before
,
cause
),
_result
(
NULL
),
_word_size
(
word_size
)
{
// Only report if operation was really caused by an allocation.
if
(
_word_size
!=
0
)
{
AllocTracer
::
send_allocation_requiring_gc_event
(
_word_size
*
HeapWordSize
,
GCId
::
peek
());
}
}
src/share/vm/gc_implementation/shared/vmGCOperations.hpp
浏览文件 @
dcf201eb
...
...
@@ -25,6 +25,7 @@
#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
#include "gc_implementation/shared/gcId.hpp"
#include "memory/heapInspection.hpp"
#include "runtime/handles.hpp"
#include "runtime/jniHandles.hpp"
...
...
@@ -168,8 +169,7 @@ class VM_CollectForAllocation : public VM_GC_Operation {
HeapWord
*
_result
;
// Allocation result (NULL if allocation failed)
public:
VM_CollectForAllocation
(
size_t
word_size
,
uint
gc_count_before
,
GCCause
::
Cause
cause
)
:
VM_GC_Operation
(
gc_count_before
,
cause
),
_result
(
NULL
),
_word_size
(
word_size
)
{}
VM_CollectForAllocation
(
size_t
word_size
,
uint
gc_count_before
,
GCCause
::
Cause
cause
);
HeapWord
*
result
()
const
{
return
_result
;
...
...
@@ -220,10 +220,7 @@ class VM_CollectForMetadataAllocation: public VM_GC_Operation {
size_t
size
,
Metaspace
::
MetadataType
mdtype
,
uint
gc_count_before
,
uint
full_gc_count_before
,
GCCause
::
Cause
gc_cause
)
:
VM_GC_Operation
(
gc_count_before
,
gc_cause
,
full_gc_count_before
,
true
),
_loader_data
(
loader_data
),
_size
(
size
),
_mdtype
(
mdtype
),
_result
(
NULL
)
{
}
GCCause
::
Cause
gc_cause
);
virtual
VMOp_Type
type
()
const
{
return
VMOp_CollectForMetadataAllocation
;
}
virtual
void
doit
();
MetaWord
*
result
()
const
{
return
_result
;
}
...
...
src/share/vm/gc_interface/allocTracer.cpp
浏览文件 @
dcf201eb
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013,
2015,
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
...
...
@@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
#include "gc_implementation/shared/gcId.hpp"
#include "gc_interface/allocTracer.hpp"
#include "trace/tracing.hpp"
#include "runtime/handles.hpp"
...
...
@@ -46,3 +47,12 @@ void AllocTracer::send_allocation_in_new_tlab_event(KlassHandle klass, size_t tl
event
.
commit
();
}
}
void
AllocTracer
::
send_allocation_requiring_gc_event
(
size_t
size
,
const
GCId
&
gcId
)
{
EventAllocationRequiringGC
event
;
if
(
event
.
should_commit
())
{
event
.
set_gcId
(
gcId
.
id
());
event
.
set_size
(
size
);
event
.
commit
();
}
}
src/share/vm/gc_interface/allocTracer.hpp
浏览文件 @
dcf201eb
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013,
2015,
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
...
...
@@ -32,6 +32,7 @@ class AllocTracer : AllStatic {
public:
static
void
send_allocation_outside_tlab_event
(
KlassHandle
klass
,
size_t
alloc_size
);
static
void
send_allocation_in_new_tlab_event
(
KlassHandle
klass
,
size_t
tlab_size
,
size_t
alloc_size
);
static
void
send_allocation_requiring_gc_event
(
size_t
size
,
const
GCId
&
gcId
);
};
#endif
/* SHARE_VM_GC_INTERFACE_ALLOCTRACER_HPP */
src/share/vm/trace/trace.xml
浏览文件 @
dcf201eb
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2012, 201
3
, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, 201
5
, 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
...
...
@@ -352,6 +352,12 @@ Declares a structure type that can be used in other events.
<value
type=
"UTF8"
field=
"name"
label=
"Name"
/>
</event>
<event
id=
"AllocationRequiringGC"
path=
"vm/gc/detailed/allocation_requiring_gc"
label=
"Allocation Requiring GC"
has_thread=
"true"
has_stacktrace=
"true"
is_instant=
"true"
>
<value
type=
"UINT"
field=
"gcId"
label=
"Pending GC ID"
relation=
"GC_ID"
/>
<value
type=
"BYTES64"
field=
"size"
label=
"Allocation Size"
/>
</event>
<!-- Compiler events -->
<event
id=
"Compilation"
path=
"vm/compiler/compilation"
label=
"Compilation"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录