Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
22f61fd7
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看板
提交
22f61fd7
编写于
7月 11, 2013
作者:
T
tamao
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
159b70eb
a7e28361
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
114 addition
and
74 deletion
+114
-74
src/share/vm/gc_implementation/shared/gcTrace.cpp
src/share/vm/gc_implementation/shared/gcTrace.cpp
+33
-18
src/share/vm/gc_implementation/shared/gcTrace.hpp
src/share/vm/gc_implementation/shared/gcTrace.hpp
+0
-22
src/share/vm/gc_implementation/shared/gcTraceSend.cpp
src/share/vm/gc_implementation/shared/gcTraceSend.cpp
+0
-21
src/share/vm/gc_implementation/shared/objectCountEventSender.cpp
...re/vm/gc_implementation/shared/objectCountEventSender.cpp
+55
-0
src/share/vm/gc_implementation/shared/objectCountEventSender.hpp
...re/vm/gc_implementation/shared/objectCountEventSender.hpp
+14
-6
src/share/vm/gc_interface/collectedHeap.cpp
src/share/vm/gc_interface/collectedHeap.cpp
+6
-6
src/share/vm/memory/heapInspection.hpp
src/share/vm/memory/heapInspection.hpp
+6
-1
未找到文件。
src/share/vm/gc_implementation/shared/gcTrace.cpp
浏览文件 @
22f61fd7
...
...
@@ -23,12 +23,14 @@
*/
#include "precompiled.hpp"
#include "gc_implementation/shared/copyFailedInfo.hpp"
#include "gc_implementation/shared/gcHeapSummary.hpp"
#include "gc_implementation/shared/gcTimer.hpp"
#include "gc_implementation/shared/gcTrace.hpp"
#include "gc_implementation/shared/
copyFailedInfo
.hpp"
#include "gc_implementation/shared/
objectCountEventSender
.hpp"
#include "memory/heapInspection.hpp"
#include "memory/referenceProcessorStats.hpp"
#include "runtime/os.hpp"
#include "utilities/globalDefinitions.hpp"
#if INCLUDE_ALL_GCS
...
...
@@ -38,7 +40,7 @@
#define assert_unset_gc_id() assert(_shared_gc_info.id() == SharedGCInfo::UNSET_GCID, "GC already started?")
#define assert_set_gc_id() assert(_shared_gc_info.id() != SharedGCInfo::UNSET_GCID, "GC not started?")
static
jlong
GCTracer_next_gc_id
=
0
;
static
GCId
GCTracer_next_gc_id
=
0
;
static
GCId
create_new_gc_id
()
{
return
GCTracer_next_gc_id
++
;
}
...
...
@@ -91,26 +93,38 @@ void GCTracer::report_gc_reference_stats(const ReferenceProcessorStats& rps) con
}
#if INCLUDE_SERVICES
void
ObjectCountEventSenderClosure
::
do_cinfo
(
KlassInfoEntry
*
entry
)
{
if
(
should_send_event
(
entry
))
{
send_event
(
entry
);
class
ObjectCountEventSenderClosure
:
public
KlassInfoClosure
{
const
GCId
_gc_id
;
const
double
_size_threshold_percentage
;
const
size_t
_total_size_in_words
;
const
jlong
_timestamp
;
public:
ObjectCountEventSenderClosure
(
GCId
gc_id
,
size_t
total_size_in_words
,
jlong
timestamp
)
:
_gc_id
(
gc_id
),
_size_threshold_percentage
(
ObjectCountCutOffPercent
/
100
),
_total_size_in_words
(
total_size_in_words
),
_timestamp
(
timestamp
)
{}
virtual
void
do_cinfo
(
KlassInfoEntry
*
entry
)
{
if
(
should_send_event
(
entry
))
{
ObjectCountEventSender
::
send
(
entry
,
_gc_id
,
_timestamp
);
}
}
}
void
ObjectCountEventSenderClosure
::
send_event
(
KlassInfoEntry
*
entry
)
{
_gc_tracer
->
send_object_count_after_gc_event
(
entry
->
klass
(),
entry
->
count
(),
entry
->
words
()
*
BytesPerWord
);
}
bool
ObjectCountEventSenderClosure
::
should_send_event
(
KlassInfoEntry
*
entry
)
const
{
double
percentage_of_heap
=
((
double
)
entry
->
words
())
/
_total_size_in_words
;
return
percentage_of_heap
>
_size_threshold_percentage
;
}
private:
bool
should_send_event
(
const
KlassInfoEntry
*
entry
)
const
{
double
percentage_of_heap
=
((
double
)
entry
->
words
())
/
_total_size_in_words
;
return
percentage_of_heap
>=
_size_threshold_percentage
;
}
};
void
GCTracer
::
report_object_count_after_gc
(
BoolObjectClosure
*
is_alive_cl
)
{
assert_set_gc_id
();
assert
(
is_alive_cl
!=
NULL
,
"Must supply function to check liveness"
);
if
(
should_send_object_count_after_gc
_event
())
{
if
(
ObjectCountEventSender
::
should_send
_event
())
{
ResourceMark
rm
;
KlassInfoTable
cit
(
false
);
...
...
@@ -118,12 +132,13 @@ void GCTracer::report_object_count_after_gc(BoolObjectClosure* is_alive_cl) {
HeapInspection
hi
(
false
,
false
,
false
,
NULL
);
hi
.
populate_table
(
&
cit
,
is_alive_cl
);
ObjectCountEventSenderClosure
event_sender
(
this
,
cit
.
size_of_instances_in_words
());
jlong
timestamp
=
os
::
elapsed_counter
();
ObjectCountEventSenderClosure
event_sender
(
_shared_gc_info
.
id
(),
cit
.
size_of_instances_in_words
(),
timestamp
);
cit
.
iterate
(
&
event_sender
);
}
}
}
#endif
#endif
// INCLUDE_SERVICES
void
GCTracer
::
report_gc_heap_summary
(
GCWhen
::
Type
when
,
const
GCHeapSummary
&
heap_summary
,
const
MetaspaceSummary
&
meta_space_summary
)
const
{
assert_set_gc_id
();
...
...
src/share/vm/gc_implementation/shared/gcTrace.hpp
浏览文件 @
22f61fd7
...
...
@@ -30,7 +30,6 @@
#include "gc_implementation/shared/gcWhen.hpp"
#include "gc_implementation/shared/copyFailedInfo.hpp"
#include "memory/allocation.hpp"
#include "memory/klassInfoClosure.hpp"
#include "memory/referenceType.hpp"
#if INCLUDE_ALL_GCS
#include "gc_implementation/g1/g1YCTypes.hpp"
...
...
@@ -113,7 +112,6 @@ class G1YoungGCInfo VALUE_OBJ_CLASS_SPEC {
#endif // INCLUDE_ALL_GCS
class
GCTracer
:
public
ResourceObj
{
friend
class
ObjectCountEventSenderClosure
;
protected:
SharedGCInfo
_shared_gc_info
;
...
...
@@ -123,7 +121,6 @@ class GCTracer : public ResourceObj {
void
report_gc_heap_summary
(
GCWhen
::
Type
when
,
const
GCHeapSummary
&
heap_summary
,
const
MetaspaceSummary
&
meta_space_summary
)
const
;
void
report_gc_reference_stats
(
const
ReferenceProcessorStats
&
rp
)
const
;
void
report_object_count_after_gc
(
BoolObjectClosure
*
object_filter
)
NOT_SERVICES_RETURN
;
bool
has_reported_gc_start
()
const
;
protected:
...
...
@@ -137,25 +134,6 @@ class GCTracer : public ResourceObj {
void
send_meta_space_summary_event
(
GCWhen
::
Type
when
,
const
MetaspaceSummary
&
meta_space_summary
)
const
;
void
send_reference_stats_event
(
ReferenceType
type
,
size_t
count
)
const
;
void
send_phase_events
(
TimePartitions
*
time_partitions
)
const
;
void
send_object_count_after_gc_event
(
Klass
*
klass
,
jlong
count
,
julong
total_size
)
const
NOT_SERVICES_RETURN
;
bool
should_send_object_count_after_gc_event
()
const
;
};
class
ObjectCountEventSenderClosure
:
public
KlassInfoClosure
{
GCTracer
*
_gc_tracer
;
const
double
_size_threshold_percentage
;
const
size_t
_total_size_in_words
;
public:
ObjectCountEventSenderClosure
(
GCTracer
*
gc_tracer
,
size_t
total_size_in_words
)
:
_gc_tracer
(
gc_tracer
),
_size_threshold_percentage
(
ObjectCountCutOffPercent
/
100
),
_total_size_in_words
(
total_size_in_words
)
{}
virtual
void
do_cinfo
(
KlassInfoEntry
*
entry
);
protected:
virtual
void
send_event
(
KlassInfoEntry
*
entry
);
private:
bool
should_send_event
(
KlassInfoEntry
*
entry
)
const
;
};
class
YoungGCTracer
:
public
GCTracer
{
...
...
src/share/vm/gc_implementation/shared/gcTraceSend.cpp
浏览文件 @
22f61fd7
...
...
@@ -123,27 +123,6 @@ void OldGCTracer::send_concurrent_mode_failure_event() {
}
}
#if INCLUDE_SERVICES
void
GCTracer
::
send_object_count_after_gc_event
(
Klass
*
klass
,
jlong
count
,
julong
total_size
)
const
{
EventObjectCountAfterGC
e
;
if
(
e
.
should_commit
())
{
e
.
set_gcId
(
_shared_gc_info
.
id
());
e
.
set_class
(
klass
);
e
.
set_count
(
count
);
e
.
set_totalSize
(
total_size
);
e
.
commit
();
}
}
#endif
bool
GCTracer
::
should_send_object_count_after_gc_event
()
const
{
#if INCLUDE_TRACE
return
Tracing
::
is_event_enabled
(
EventObjectCountAfterGC
::
eventId
);
#else
return
false
;
#endif
}
#if INCLUDE_ALL_GCS
void
G1NewTracer
::
send_g1_young_gc_event
()
{
EventGCG1GarbageCollection
e
(
UNTIMED
);
...
...
src/share/vm/gc_implementation/shared/objectCountEventSender.cpp
0 → 100644
浏览文件 @
22f61fd7
/*
* Copyright (c) 2013, 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 "gc_implementation/shared/objectCountEventSender.hpp"
#include "memory/heapInspection.hpp"
#include "trace/tracing.hpp"
#include "utilities/globalDefinitions.hpp"
#if INCLUDE_SERVICES
void
ObjectCountEventSender
::
send
(
const
KlassInfoEntry
*
entry
,
GCId
gc_id
,
jlong
timestamp
)
{
assert
(
Tracing
::
is_event_enabled
(
EventObjectCountAfterGC
::
eventId
),
"Only call this method if the event is enabled"
);
EventObjectCountAfterGC
event
(
UNTIMED
);
event
.
set_gcId
(
gc_id
);
event
.
set_class
(
entry
->
klass
());
event
.
set_count
(
entry
->
count
());
event
.
set_totalSize
(
entry
->
words
()
*
BytesPerWord
);
event
.
set_endtime
(
timestamp
);
event
.
commit
();
}
bool
ObjectCountEventSender
::
should_send_event
()
{
#if INCLUDE_TRACE
return
Tracing
::
is_event_enabled
(
EventObjectCountAfterGC
::
eventId
);
#else
return
false
;
#endif // INCLUDE_TRACE
}
#endif // INCLUDE_SERVICES
src/share/vm/
memory/klassInfoClosure
.hpp
→
src/share/vm/
gc_implementation/shared/objectCountEventSender
.hpp
浏览文件 @
22f61fd7
...
...
@@ -22,15 +22,23 @@
*
*/
#ifndef SHARE_VM_MEMORY_KLASSINFOCLOSURE_HPP
#define SHARE_VM_MEMORY_KLASSINFOCLOSURE_HPP
#ifndef SHARE_VM_OBJECT_COUNT_EVENT_SENDER_HPP
#define SHARE_VM_OBJECT_COUNT_EVENT_SENDER_HPP
#include "gc_implementation/shared/gcTrace.hpp"
#include "memory/allocation.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_SERVICES
class
KlassInfoEntry
;
class
KlassInfoClosure
:
public
StackObj
{
class
ObjectCountEventSender
:
public
AllStatic
{
public:
// Called for each KlassInfoEntry.
virtual
void
do_cinfo
(
KlassInfoEntry
*
cie
)
=
0
;
static
void
send
(
const
KlassInfoEntry
*
entry
,
GCId
gc_id
,
jlong
timestamp
);
static
bool
should_send_event
()
;
};
#endif // SHARE_VM_MEMORY_KLASSINFOCLOSURE_HPP
#endif // INCLUDE_SERVICES
#endif // SHARE_VM_OBJECT_COUNT_EVENT_SENDER
src/share/vm/gc_interface/collectedHeap.cpp
浏览文件 @
22f61fd7
...
...
@@ -85,16 +85,16 @@ GCHeapSummary CollectedHeap::create_heap_summary() {
MetaspaceSummary
CollectedHeap
::
create_metaspace_summary
()
{
const
MetaspaceSizes
meta_space
(
0
,
/*MetaspaceAux::capacity_in_bytes(),*/
0
,
/*MetaspaceAux::used_in_bytes(),*/
MetaspaceAux
::
allocated_capacity_bytes
(),
MetaspaceAux
::
allocated_used_bytes
(),
MetaspaceAux
::
reserved_in_bytes
());
const
MetaspaceSizes
data_space
(
0
,
/*MetaspaceAux::capacity_in_bytes(Metaspace::NonClassType),*/
0
,
/*MetaspaceAux::used_in_bytes(Metaspace::NonClassType),*/
MetaspaceAux
::
allocated_capacity_bytes
(
Metaspace
::
NonClassType
),
MetaspaceAux
::
allocated_used_bytes
(
Metaspace
::
NonClassType
),
MetaspaceAux
::
reserved_in_bytes
(
Metaspace
::
NonClassType
));
const
MetaspaceSizes
class_space
(
0
,
/*MetaspaceAux::capacity_in_bytes(Metaspace::ClassType),*/
0
,
/*MetaspaceAux::used_in_bytes(Metaspace::ClassType),*/
MetaspaceAux
::
allocated_capacity_bytes
(
Metaspace
::
ClassType
),
MetaspaceAux
::
allocated_used_bytes
(
Metaspace
::
ClassType
),
MetaspaceAux
::
reserved_in_bytes
(
Metaspace
::
ClassType
));
return
MetaspaceSummary
(
meta_space
,
data_space
,
class_space
);
...
...
src/share/vm/memory/heapInspection.hpp
浏览文件 @
22f61fd7
...
...
@@ -26,7 +26,6 @@
#define SHARE_VM_MEMORY_HEAPINSPECTION_HPP
#include "memory/allocation.inline.hpp"
#include "memory/klassInfoClosure.hpp"
#include "oops/oop.inline.hpp"
#include "oops/annotations.hpp"
#include "utilities/macros.hpp"
...
...
@@ -204,6 +203,12 @@ class KlassInfoEntry: public CHeapObj<mtInternal> {
const
char
*
name
()
const
;
};
class
KlassInfoClosure
:
public
StackObj
{
public:
// Called for each KlassInfoEntry.
virtual
void
do_cinfo
(
KlassInfoEntry
*
cie
)
=
0
;
};
class
KlassInfoBucket
:
public
CHeapObj
<
mtInternal
>
{
private:
KlassInfoEntry
*
_list
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录