Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
f38f61e5
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看板
提交
f38f61e5
编写于
10月 03, 2011
作者:
T
tonyp
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7097048: G1: extend the G1 SA changes to print per-heap space information
Reviewed-by: brutisso, johnc
上级
a5d76e84
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
137 addition
and
11 deletion
+137
-11
agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1CollectedHeap.java
...sun/jvm/hotspot/gc_implementation/g1/G1CollectedHeap.java
+9
-0
agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1MonitoringSupport.java
...jvm/hotspot/gc_implementation/g1/G1MonitoringSupport.java
+99
-0
agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
.../src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
+16
-11
src/share/vm/gc_implementation/g1/g1MonitoringSupport.hpp
src/share/vm/gc_implementation/g1/g1MonitoringSupport.hpp
+2
-0
src/share/vm/gc_implementation/g1/vmStructs_g1.hpp
src/share/vm/gc_implementation/g1/vmStructs_g1.hpp
+11
-0
未找到文件。
agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1CollectedHeap.java
浏览文件 @
f38f61e5
...
...
@@ -35,6 +35,7 @@ import sun.jvm.hotspot.memory.SharedHeap;
import
sun.jvm.hotspot.memory.SpaceClosure
;
import
sun.jvm.hotspot.runtime.VM
;
import
sun.jvm.hotspot.runtime.VMObjectFactory
;
import
sun.jvm.hotspot.types.AddressField
;
import
sun.jvm.hotspot.types.CIntegerField
;
import
sun.jvm.hotspot.types.Type
;
import
sun.jvm.hotspot.types.TypeDataBase
;
...
...
@@ -48,6 +49,8 @@ public class G1CollectedHeap extends SharedHeap {
static
private
long
g1CommittedFieldOffset
;
// size_t _summary_bytes_used;
static
private
CIntegerField
summaryBytesUsedField
;
// G1MonitoringSupport* _g1mm
static
private
AddressField
g1mmField
;
static
{
VM
.
registerVMInitializedObserver
(
new
Observer
()
{
...
...
@@ -63,6 +66,7 @@ public class G1CollectedHeap extends SharedHeap {
hrsFieldOffset
=
type
.
getField
(
"_hrs"
).
getOffset
();
g1CommittedFieldOffset
=
type
.
getField
(
"_g1_committed"
).
getOffset
();
summaryBytesUsedField
=
type
.
getCIntegerField
(
"_summary_bytes_used"
);
g1mmField
=
type
.
getAddressField
(
"_g1mm"
);
}
public
long
capacity
()
{
...
...
@@ -85,6 +89,11 @@ public class G1CollectedHeap extends SharedHeap {
hrsAddr
);
}
public
G1MonitoringSupport
g1mm
()
{
Address
g1mmAddr
=
g1mmField
.
getValue
(
addr
);
return
(
G1MonitoringSupport
)
VMObjectFactory
.
newObject
(
G1MonitoringSupport
.
class
,
g1mmAddr
);
}
private
Iterator
<
HeapRegion
>
heapRegionIterator
()
{
return
hrs
().
heapRegionIterator
();
}
...
...
agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1MonitoringSupport.java
0 → 100644
浏览文件 @
f38f61e5
/*
* Copyright (c) 2011, 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.
*
*/
package
sun.jvm.hotspot.gc_implementation.g1
;
import
java.util.Observable
;
import
java.util.Observer
;
import
sun.jvm.hotspot.debugger.Address
;
import
sun.jvm.hotspot.runtime.VM
;
import
sun.jvm.hotspot.runtime.VMObject
;
import
sun.jvm.hotspot.types.CIntegerField
;
import
sun.jvm.hotspot.types.Type
;
import
sun.jvm.hotspot.types.TypeDataBase
;
// Mirror class for G1MonitoringSupport.
public
class
G1MonitoringSupport
extends
VMObject
{
// size_t _eden_committed;
static
private
CIntegerField
edenCommittedField
;
// size_t _eden_used;
static
private
CIntegerField
edenUsedField
;
// size_t _survivor_committed;
static
private
CIntegerField
survivorCommittedField
;
// size_t _survivor_used;
static
private
CIntegerField
survivorUsedField
;
// size_t _old_committed;
static
private
CIntegerField
oldCommittedField
;
// size_t _old_used;
static
private
CIntegerField
oldUsedField
;
static
{
VM
.
registerVMInitializedObserver
(
new
Observer
()
{
public
void
update
(
Observable
o
,
Object
data
)
{
initialize
(
VM
.
getVM
().
getTypeDataBase
());
}
});
}
static
private
synchronized
void
initialize
(
TypeDataBase
db
)
{
Type
type
=
db
.
lookupType
(
"G1MonitoringSupport"
);
edenCommittedField
=
type
.
getCIntegerField
(
"_eden_committed"
);
edenUsedField
=
type
.
getCIntegerField
(
"_eden_used"
);
survivorCommittedField
=
type
.
getCIntegerField
(
"_survivor_committed"
);
survivorUsedField
=
type
.
getCIntegerField
(
"_survivor_used"
);
oldCommittedField
=
type
.
getCIntegerField
(
"_old_committed"
);
oldUsedField
=
type
.
getCIntegerField
(
"_old_used"
);
}
public
long
edenCommitted
()
{
return
edenCommittedField
.
getValue
(
addr
);
}
public
long
edenUsed
()
{
return
edenUsedField
.
getValue
(
addr
);
}
public
long
survivorCommitted
()
{
return
survivorCommittedField
.
getValue
(
addr
);
}
public
long
survivorUsed
()
{
return
survivorUsedField
.
getValue
(
addr
);
}
public
long
oldCommitted
()
{
return
oldCommittedField
.
getValue
(
addr
);
}
public
long
oldUsed
()
{
return
oldUsedField
.
getValue
(
addr
);
}
public
G1MonitoringSupport
(
Address
addr
)
{
super
(
addr
);
}
}
agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
浏览文件 @
f38f61e5
...
...
@@ -98,17 +98,12 @@ public class HeapSummary extends Tool {
}
}
else
if
(
sharedHeap
instanceof
G1CollectedHeap
)
{
G1CollectedHeap
g1h
=
(
G1CollectedHeap
)
sharedHeap
;
System
.
out
.
println
(
"Garbage-First (G1) Heap"
);
long
capacityBytes
=
g1h
.
capacity
();
long
usedBytes
=
g1h
.
used
();
long
freeBytes
=
capacityBytes
-
usedBytes
;
printValMB
(
"region size = "
,
HeapRegion
.
grainBytes
());
printValue
(
"regions = "
,
g1h
.
n_regions
());
printValMB
(
"capacity = "
,
capacityBytes
);
printValMB
(
"used = "
,
usedBytes
);
printValMB
(
"free = "
,
freeBytes
);
System
.
out
.
println
(
alignment
+
(
double
)
usedBytes
*
100.0
/
capacityBytes
+
"% used"
);
G1MonitoringSupport
g1mm
=
g1h
.
g1mm
();
System
.
out
.
println
(
"G1 Young Generation"
);
printG1Space
(
"Eden Space:"
,
g1mm
.
edenUsed
(),
g1mm
.
edenCommitted
());
printG1Space
(
"From Space:"
,
g1mm
.
survivorUsed
(),
g1mm
.
survivorCommitted
());
printG1Space
(
"To Space:"
,
0
,
0
);
printG1Space
(
"G1 Old Generation"
,
g1mm
.
oldUsed
(),
g1mm
.
oldCommitted
());
}
else
{
throw
new
RuntimeException
(
"unknown SharedHeap type : "
+
heap
.
getClass
());
}
...
...
@@ -217,6 +212,16 @@ public class HeapSummary extends Tool {
System
.
out
.
println
(
alignment
+
(
double
)
space
.
used
()
*
100.0
/
space
.
capacity
()
+
"% used"
);
}
private
void
printG1Space
(
String
spaceName
,
long
used
,
long
capacity
)
{
long
free
=
capacity
-
used
;
System
.
out
.
println
(
spaceName
);
printValMB
(
"capacity = "
,
capacity
);
printValMB
(
"used = "
,
used
);
printValMB
(
"free = "
,
free
);
double
occPerc
=
(
capacity
>
0
)
?
(
double
)
used
*
100.0
/
capacity
:
0.0
;
System
.
out
.
println
(
alignment
+
occPerc
+
"% used"
);
}
private
static
final
double
FACTOR
=
1024
*
1024
;
private
void
printValMB
(
String
title
,
long
value
)
{
if
(
value
<
0
)
{
...
...
src/share/vm/gc_implementation/g1/g1MonitoringSupport.hpp
浏览文件 @
f38f61e5
...
...
@@ -114,6 +114,8 @@ class G1CollectedHeap;
// path as low-overhead as possible.
class
G1MonitoringSupport
:
public
CHeapObj
{
friend
class
VMStructs
;
G1CollectedHeap
*
_g1h
;
// jstat performance counters
...
...
src/share/vm/gc_implementation/g1/vmStructs_g1.hpp
浏览文件 @
f38f61e5
...
...
@@ -39,6 +39,14 @@
nonstatic_field(G1CollectedHeap, _hrs, HeapRegionSeq) \
nonstatic_field(G1CollectedHeap, _g1_committed, MemRegion) \
nonstatic_field(G1CollectedHeap, _summary_bytes_used, size_t) \
nonstatic_field(G1CollectedHeap, _g1mm, G1MonitoringSupport*) \
\
nonstatic_field(G1MonitoringSupport, _eden_committed, size_t) \
nonstatic_field(G1MonitoringSupport, _eden_used, size_t) \
nonstatic_field(G1MonitoringSupport, _survivor_committed, size_t) \
nonstatic_field(G1MonitoringSupport, _survivor_used, size_t) \
nonstatic_field(G1MonitoringSupport, _old_committed, size_t) \
nonstatic_field(G1MonitoringSupport, _old_used, size_t) \
#define VM_TYPES_G1(declare_type, declare_toplevel_type) \
...
...
@@ -47,8 +55,11 @@
\
declare_type(HeapRegion, ContiguousSpace) \
declare_toplevel_type(HeapRegionSeq) \
declare_toplevel_type(G1MonitoringSupport) \
\
declare_toplevel_type(G1CollectedHeap*) \
declare_toplevel_type(HeapRegion*) \
declare_toplevel_type(G1MonitoringSupport*) \
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_VMSTRUCTS_G1_HPP
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录