问题描述
我正在学习jstat,它可以告诉我关于JVM不同世代的信息。从,我了解新一代由伊甸园,s0和s1组成。例如,如果您对以下内容进行数学运算,您会看到NGC = EC + S0C + S1C。
$ jstat -gccapacity -t 21830 5000
时间戳NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC PGCMN PGCMX PGC PC YGC FGC
248767.4 2624.0 87360.0 6656.0 640.0 640.0 5376.0 5376.0 174784.0 12840.0 12840.0 21248.0 131072.0 34304.0 34304.0 457 73
248772.4 2624.0 87360.0 6656.0 640.0 640.0 5376.0 5376.0 174784.0 12840.0 12840.0 21248.0 131072.0 34304.0 34304.0 457 73
248777.3 2624.0 87360.0 6656.0 640.0 640.0 5376.0 5376.0 174784.0 12840.0 12840.0 21248.0 131072.0 34304.0 34304.0 457 73
I' m想知道有什么区别:
同样适用于: 每对货币都有相同的价值,至少对我来说,现在。旧的空间旁边有没有任何东西?
编辑:我不认为有什么区别,
我只是寻求jdk源码
简而言之:
OGC = sum(all OC)
可能包含超过一个空格。
然而,Hotspot旧有只有1个空间(年轻的gen有3:eden,s0和s1),
jstat显示它们的价值相同。
什么是OC和OGC
from
jdk / src / share / classes / sun / tools / jstat / resources / jstat_options
$ b
OGC = sun.gc.generation.1.capacity
OC = sun.gc.generation.1.space.0.capacity
专栏{
header'^ OGC ^/ *旧一代容量 - 当前* /
数据sun.gc.generation.1.capaci ty
scale K
align right
width 11
format0.0
}
column {
header^ OC ^/ *旧空间容量 - 当前* /
数据sun.gc.generation.1.space.0.capacity
比例K
右对齐
宽度11
格式0.0
GEN.1中的多少空间
运行下面的groovy代码来检查
import java.lang.management .ManagementFactory
import sun.jvmstat.monitor。*;
name = ManagementFactory.runtimeMXBean.name
pid = name [0 ..< name.indexOf('@')]
vmId = new VmIdentifier(pid)
vm = MonitoredHost.getMonitoredHost(vmId).getMonitoredVm(vmId,0)
println'Y count:'+ vm.findByName('sun.gc.generation.0.spaces')。longValue ()
println'O count:'+ vm.findByName('sun.gc.generation.1.spaces')。longValue()
输出为:
Y计数:3
O计数: 1
您可以对GEN.2(PERM GEN)进行同样的操作
I'm learning about jstat and what it can tell me about the JVM's different generations. From the jstat docs I understand the new gen is made up of eden, s0 and s1. For example, if you do the math on the following, you see that NGC = EC + S0C + S1C. Great stuff.
$ jstat -gccapacity -t 21830 5000
Timestamp NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC PGCMN PGCMX PGC PC YGC FGC
248767.4 2624.0 87360.0 6656.0 640.0 640.0 5376.0 5376.0 174784.0 12840.0 12840.0 21248.0 131072.0 34304.0 34304.0 457 73
248772.4 2624.0 87360.0 6656.0 640.0 640.0 5376.0 5376.0 174784.0 12840.0 12840.0 21248.0 131072.0 34304.0 34304.0 457 73
248777.3 2624.0 87360.0 6656.0 640.0 640.0 5376.0 5376.0 174784.0 12840.0 12840.0 21248.0 131072.0 34304.0 34304.0 457 73
I'm wondering what's the difference between:
- OGC (Current old generation capacity (KB)) and
- OC (Current old space capacity (KB)).
And similarly for:
- PGC (Current Permanent generation capacity (KB)) and
- PC (Current Permanent space capacity (KB)).
Each pair has the same value, at least for me, right now. Is there ever anything in the old generation beside the old space?
Edit: I don't think there is a difference, but I'll leave this question up just in case.
I just seek from the jdk source
in short:OGC = sum(all OC)
A gen may contain MORE THAN ONE spaces.
However, Hotspot old gen has only 1 space ( young gen has 3: eden , s0 and s1 ),jstat shows the same value for them.
WHAT IS OC and OGC
from jdk/src/share/classes/sun/tools/jstat/resources/jstat_options
I got
OGC = sun.gc.generation.1.capacity
OC = sun.gc.generation.1.space.0.capacity
column {
header "^OGC^" /* Old Generation Capacity - Current */
data sun.gc.generation.1.capacity
scale K
align right
width 11
format "0.0"
}
column {
header "^OC^" /* Old Space Capacity - Current */
data sun.gc.generation.1.space.0.capacity
scale K
align right
width 11
format "0.0"
}
HOW MANY SPACES IN GEN.1
run groovy code below to examine
import java.lang.management.ManagementFactory
import sun.jvmstat.monitor.*;
name = ManagementFactory.runtimeMXBean.name
pid = name[0..<name.indexOf('@')]
vmId = new VmIdentifier(pid)
vm = MonitoredHost.getMonitoredHost(vmId).getMonitoredVm(vmId, 0)
println 'Y count :' + vm.findByName('sun.gc.generation.0.spaces').longValue()
println 'O count :' + vm.findByName('sun.gc.generation.1.spaces').longValue()
output is:
Y count :3
O count :1
You can do the same for GEN.2 (PERM GEN)
这篇关于jstat:OGC& OC,PGC&个人计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!