changeset 5981:537c8e21b118

8036696: Add metaspace gc threshold to metaspace summary trace event Reviewed-by: jmasa, stefank, mgerdin
author ehelin
date Fri, 21 Mar 2014 10:16:35 +0100
parents 6e7e363c5a8f
children daef39043d2c
files src/share/vm/gc_implementation/shared/gcHeapSummary.hpp src/share/vm/gc_implementation/shared/gcTraceSend.cpp src/share/vm/gc_interface/collectedHeap.cpp src/share/vm/trace/trace.xml
diffstat 4 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/gcHeapSummary.hpp	Mon Mar 24 09:14:14 2014 -0700
+++ b/src/share/vm/gc_implementation/shared/gcHeapSummary.hpp	Fri Mar 21 10:16:35 2014 +0100
@@ -125,15 +125,17 @@
 };
 
 class MetaspaceSummary : public StackObj {
+  size_t _capacity_until_GC;
   MetaspaceSizes _meta_space;
   MetaspaceSizes _data_space;
   MetaspaceSizes _class_space;
 
  public:
-  MetaspaceSummary() : _meta_space(), _data_space(), _class_space() {}
-  MetaspaceSummary(const MetaspaceSizes& meta_space, const MetaspaceSizes& data_space, const MetaspaceSizes& class_space) :
-       _meta_space(meta_space), _data_space(data_space), _class_space(class_space) { }
+  MetaspaceSummary() : _capacity_until_GC(0), _meta_space(), _data_space(), _class_space() {}
+  MetaspaceSummary(size_t capacity_until_GC, const MetaspaceSizes& meta_space, const MetaspaceSizes& data_space, const MetaspaceSizes& 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& data_space() const { return _data_space; }
   const MetaspaceSizes& class_space() const { return _class_space; }
--- a/src/share/vm/gc_implementation/shared/gcTraceSend.cpp	Mon Mar 24 09:14:14 2014 -0700
+++ b/src/share/vm/gc_implementation/shared/gcTraceSend.cpp	Fri Mar 21 10:16:35 2014 +0100
@@ -246,6 +246,7 @@
   if (e.should_commit()) {
     e.set_gcId(_shared_gc_info.id());
     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_dataSpace(to_trace_struct(meta_space_summary.data_space()));
     e.set_classSpace(to_trace_struct(meta_space_summary.class_space()));
--- a/src/share/vm/gc_interface/collectedHeap.cpp	Mon Mar 24 09:14:14 2014 -0700
+++ b/src/share/vm/gc_interface/collectedHeap.cpp	Fri Mar 21 10:16:35 2014 +0100
@@ -97,7 +97,7 @@
       MetaspaceAux::allocated_used_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() {
--- a/src/share/vm/trace/trace.xml	Mon Mar 24 09:14:14 2014 -0700
+++ b/src/share/vm/trace/trace.xml	Fri Mar 21 10:16:35 2014 +0100
@@ -193,6 +193,7 @@
     <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="GCWHEN" field="when" label="When" />
+      <value type="BYTES64" field="gcThreshold" label="GC Threshold" />
       <structvalue type="MetaspaceSizes" field="metaspace" label="Total"/>
       <structvalue type="MetaspaceSizes" field="dataSpace" label="Data"/>
       <structvalue type="MetaspaceSizes" field="classSpace" label="Class"/>