提交 c148f71d 编写于 作者: E ehelin

8036696: Add metaspace gc threshold to metaspace summary trace event

Reviewed-by: jmasa, stefank, mgerdin
上级 e19f4721
...@@ -125,15 +125,17 @@ class PSHeapSummary : public GCHeapSummary { ...@@ -125,15 +125,17 @@ class PSHeapSummary : public GCHeapSummary {
}; };
class MetaspaceSummary : public StackObj { class MetaspaceSummary : public StackObj {
size_t _capacity_until_GC;
MetaspaceSizes _meta_space; MetaspaceSizes _meta_space;
MetaspaceSizes _data_space; MetaspaceSizes _data_space;
MetaspaceSizes _class_space; MetaspaceSizes _class_space;
public: public:
MetaspaceSummary() : _meta_space(), _data_space(), _class_space() {} MetaspaceSummary() : _capacity_until_GC(0), _meta_space(), _data_space(), _class_space() {}
MetaspaceSummary(const MetaspaceSizes& meta_space, const MetaspaceSizes& data_space, const MetaspaceSizes& class_space) : MetaspaceSummary(size_t capacity_until_GC, const MetaspaceSizes& meta_space, const MetaspaceSizes& data_space, const MetaspaceSizes& class_space) :
_meta_space(meta_space), _data_space(data_space), _class_space(class_space) { } _capacity_until_GC(capacity_until_GC), _meta_space(meta_space), _data_space(data_space), _class_space(class_space) { }
size_t capacity_until_GC() const { return _capacity_until_GC; }
const MetaspaceSizes& meta_space() const { return _meta_space; } const MetaspaceSizes& meta_space() const { return _meta_space; }
const MetaspaceSizes& data_space() const { return _data_space; } const MetaspaceSizes& data_space() const { return _data_space; }
const MetaspaceSizes& class_space() const { return _class_space; } const MetaspaceSizes& class_space() const { return _class_space; }
......
...@@ -246,6 +246,7 @@ void GCTracer::send_meta_space_summary_event(GCWhen::Type when, const MetaspaceS ...@@ -246,6 +246,7 @@ void GCTracer::send_meta_space_summary_event(GCWhen::Type when, const MetaspaceS
if (e.should_commit()) { if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id()); e.set_gcId(_shared_gc_info.id());
e.set_when((u1) when); e.set_when((u1) when);
e.set_gcThreshold(meta_space_summary.capacity_until_GC());
e.set_metaspace(to_trace_struct(meta_space_summary.meta_space())); e.set_metaspace(to_trace_struct(meta_space_summary.meta_space()));
e.set_dataSpace(to_trace_struct(meta_space_summary.data_space())); e.set_dataSpace(to_trace_struct(meta_space_summary.data_space()));
e.set_classSpace(to_trace_struct(meta_space_summary.class_space())); e.set_classSpace(to_trace_struct(meta_space_summary.class_space()));
......
...@@ -97,7 +97,7 @@ MetaspaceSummary CollectedHeap::create_metaspace_summary() { ...@@ -97,7 +97,7 @@ MetaspaceSummary CollectedHeap::create_metaspace_summary() {
MetaspaceAux::allocated_used_bytes(Metaspace::ClassType), MetaspaceAux::allocated_used_bytes(Metaspace::ClassType),
MetaspaceAux::reserved_bytes(Metaspace::ClassType)); MetaspaceAux::reserved_bytes(Metaspace::ClassType));
return MetaspaceSummary(meta_space, data_space, class_space); return MetaspaceSummary(MetaspaceGC::capacity_until_GC(), meta_space, data_space, class_space);
} }
void CollectedHeap::print_heap_before_gc() { void CollectedHeap::print_heap_before_gc() {
......
...@@ -193,6 +193,7 @@ Declares a structure type that can be used in other events. ...@@ -193,6 +193,7 @@ Declares a structure type that can be used in other events.
<event id="MetaspaceSummary" path="vm/gc/heap/metaspace_summary" label="Metaspace Summary" is_instant="true"> <event id="MetaspaceSummary" path="vm/gc/heap/metaspace_summary" label="Metaspace Summary" is_instant="true">
<value type="UINT" field="gcId" label="GC ID" relation="GC_ID"/> <value type="UINT" field="gcId" label="GC ID" relation="GC_ID"/>
<value type="GCWHEN" field="when" label="When" /> <value type="GCWHEN" field="when" label="When" />
<value type="BYTES64" field="gcThreshold" label="GC Threshold" />
<structvalue type="MetaspaceSizes" field="metaspace" label="Total"/> <structvalue type="MetaspaceSizes" field="metaspace" label="Total"/>
<structvalue type="MetaspaceSizes" field="dataSpace" label="Data"/> <structvalue type="MetaspaceSizes" field="dataSpace" label="Data"/>
<structvalue type="MetaspaceSizes" field="classSpace" label="Class"/> <structvalue type="MetaspaceSizes" field="classSpace" label="Class"/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册