Java任务控制堆配置文件 [英] Java Mission Control Heap Profile
问题描述
我正在使用随Java 7u40提供的新Java Java任务控制分析器,并且我无法使用配置文件分配和收集对象统计信息。无论我做什么,我都无法在内存 - > 对象统计信息窗口中看到任何统计信息。
以下命令启动集合:
jcmd< pid> JFR.start duration = 60s settings = profile filename = alloc-prof.jfr
Java Mission Control文档没有提及启用对象分析的任何特定选项。我试图创建自己的配置文件并设置:
$ p $ < flag name =heap-statistics-enabledlabel =堆统计>真< /标志>
< flag name =allocation-profiling-enabledlabel =Allocation Profiling> true< / flag>
但是仍然没有收集对象统计信息。
使用Mission Control中提供的模板管理器。
转到Windows - >模板管理器并导入模板并检查堆统计和分配分析,导出它。完成!
如果您想手动编辑jfc文件,那么知道控件元素内部的元素不会被JVM读取,元素,JMC使用它们来修改控件元素外部的参数(具有控件属性的元素)
手动编辑需要您修改以下内容:
设置java / object_alloc_in_new_TLAB为真
设置java / object_alloc_outside_TLAB为true
将vm / gc / detailed / object_count设置为true
请注意,有两个对象计数事件,其中object_count_after_gc会增加GC时间。如果你选择上面的那个,你会得到一个额外的GC每个记录块(这通常是足够的)
I am playing with the new Java Mission Control Profiler that is coming with the Java 7u40 and I cannot make it to profile allocation and collect object statistics. No matter what I do, I cannot see any statistics in the Memory -> Object Statistics window.
The following command starts the collection:
jcmd <pid> JFR.start duration=60s settings=profile filename=alloc-prof.jfr
The Java Mission Control documentation does not mention any specific options to enable object profiling. I have tried to create my own profile and set :
<flag name="heap-statistics-enabled" label="Heap Statistics">true</flag>
<flag name="allocation-profiling-enabled" label="Allocation Profiling">true</flag>
But still no Object Statistics are collected.
Use the template manager that is available in Mission Control.
Go to Windows -> Template Manager and import the template and check Heap Statistics and Allocation Profiling, export it. Done!
If you want to edit the jfc-file manually, it can be good to know elements inside the control-element are not read by the JVM, i.e flag-element, They are used by JMC to modify the parameters outside the control element (the one with the control attribute)
A manual edit requires that you modify these:
set java/object_alloc_in_new_TLAB enabled to true
set java/object_alloc_outside_TLAB enabled to true
set vm/gc/detailed/object_count enabled to true
Note, there are two object count events, with object_count_after_gc you will increase GC times. If you pick the one above instead, you will get one additional GC per recording chunk (which is usually sufficient)
这篇关于Java任务控制堆配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!