Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
4a396a58
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看板
提交
4a396a58
编写于
11月 08, 2011
作者:
N
never
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7108242: jinfo -permstat shouldn't report interned strings as part of perm
Reviewed-by: kvn, twisti
上级
4a3d8765
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
41 addition
and
38 deletion
+41
-38
agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
.../src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
+41
-0
agent/src/share/classes/sun/jvm/hotspot/tools/PermStat.java
agent/src/share/classes/sun/jvm/hotspot/tools/PermStat.java
+0
-38
未找到文件。
agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
浏览文件 @
4a396a58
...
...
@@ -30,6 +30,7 @@ import sun.jvm.hotspot.gc_implementation.g1.*;
import
sun.jvm.hotspot.gc_implementation.parallelScavenge.*
;
import
sun.jvm.hotspot.gc_implementation.shared.*
;
import
sun.jvm.hotspot.memory.*
;
import
sun.jvm.hotspot.oops.*
;
import
sun.jvm.hotspot.runtime.*
;
public
class
HeapSummary
extends
Tool
{
...
...
@@ -134,6 +135,9 @@ public class HeapSummary extends Tool {
}
else
{
throw
new
RuntimeException
(
"unknown CollectedHeap type : "
+
heap
.
getClass
());
}
System
.
out
.
println
();
printInternStringStatistics
();
}
// Helper methods
...
...
@@ -248,4 +252,41 @@ public class HeapSummary extends Tool {
return
-
1
;
}
}
private
void
printInternStringStatistics
()
{
class
StringStat
implements
StringTable
.
StringVisitor
{
private
int
count
;
private
long
size
;
private
OopField
stringValueField
;
StringStat
()
{
VM
vm
=
VM
.
getVM
();
SystemDictionary
sysDict
=
vm
.
getSystemDictionary
();
InstanceKlass
strKlass
=
sysDict
.
getStringKlass
();
// String has a field named 'value' of type 'char[]'.
stringValueField
=
(
OopField
)
strKlass
.
findField
(
"value"
,
"[C"
);
}
private
long
stringSize
(
Instance
instance
)
{
// We include String content in size calculation.
return
instance
.
getObjectSize
()
+
stringValueField
.
getValue
(
instance
).
getObjectSize
();
}
public
void
visit
(
Instance
str
)
{
count
++;
size
+=
stringSize
(
str
);
}
public
void
print
()
{
System
.
out
.
println
(
count
+
" interned Strings occupying "
+
size
+
" bytes."
);
}
}
StringStat
stat
=
new
StringStat
();
StringTable
strTable
=
VM
.
getVM
().
getStringTable
();
strTable
.
stringsDo
(
stat
);
stat
.
print
();
}
}
agent/src/share/classes/sun/jvm/hotspot/tools/PermStat.java
浏览文件 @
4a396a58
...
...
@@ -63,47 +63,9 @@ public class PermStat extends Tool {
}
public
void
run
()
{
printInternStringStatistics
();
printClassLoaderStatistics
();
}
private
void
printInternStringStatistics
()
{
class
StringStat
implements
StringTable
.
StringVisitor
{
private
int
count
;
private
long
size
;
private
OopField
stringValueField
;
StringStat
()
{
VM
vm
=
VM
.
getVM
();
SystemDictionary
sysDict
=
vm
.
getSystemDictionary
();
InstanceKlass
strKlass
=
sysDict
.
getStringKlass
();
// String has a field named 'value' of type 'char[]'.
stringValueField
=
(
OopField
)
strKlass
.
findField
(
"value"
,
"[C"
);
}
private
long
stringSize
(
Instance
instance
)
{
// We include String content in size calculation.
return
instance
.
getObjectSize
()
+
stringValueField
.
getValue
(
instance
).
getObjectSize
();
}
public
void
visit
(
Instance
str
)
{
count
++;
size
+=
stringSize
(
str
);
}
public
void
print
()
{
System
.
out
.
println
(
count
+
" intern Strings occupying "
+
size
+
" bytes."
);
}
}
StringStat
stat
=
new
StringStat
();
StringTable
strTable
=
VM
.
getVM
().
getStringTable
();
strTable
.
stringsDo
(
stat
);
stat
.
print
();
}
private
void
printClassLoaderStatistics
()
{
final
PrintStream
out
=
System
.
out
;
final
PrintStream
err
=
System
.
err
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录