< prev index next >

src/hotspot/share/memory/heap.hpp

Print this page

        

@@ -215,8 +215,83 @@
 
 public:
   // Debugging
   void verify() PRODUCT_RETURN;
   void print()  PRODUCT_RETURN;
+
+  //---<  BEGIN  >--- 8198691: CodeHeap State Analytics.
+
+ public:
+  enum compType {
+    noComp = 0     // must be! due to initialization by memset to zero
+  , c1
+  , c2
+  , jvmci
+  , lastComp
+  };
+
+  enum blobType {
+     noType = 0     // must be! due to initialization by memset to zero
+     // The nMethod_* values correspond 1:1 to the CompiledMethod enum values.
+   , nMethod_inuse       // executable. This is the "normal" state for a nmethod.
+   , nMethod_notused     // assumed inactive, marked not entrant. Could be revived if necessary.
+   , nMethod_notentrant  // no new activations allowed, marked for deoptimization. Old activations may still exist.
+                         // Will transition to "zombie" after all activations are gone.
+   , nMethod_zombie      // No more activations exist, ready for purge (remove from code cache).
+   , nMethod_unloaded    // No activations exist, should not be called. Transient state on the way to "zombie".
+   , nMethod_alive = nMethod_notentrant // Combined state: nmethod may have activations, thus can't be purged.
+   , nMethod_dead  = nMethod_zombie     // Combined state: nmethod does not have any activations.
+   , runtimeStub   = nMethod_unloaded + 1
+   , ricochetStub
+   , deoptimizationStub
+   , uncommonTrapStub
+   , exceptionStub
+   , safepointStub
+   , adapterBlob
+   , mh_adapterBlob
+   , bufferBlob
+   , lastType
+  };
+
+ private:
+  void prepare_StatArray(outputStream *out, size_t nElem, size_t granularity, const char* heapName);
+  void prepare_FreeArray(outputStream *out, unsigned int nElem, const char* heapName);
+  void prepare_TopSizeArray(outputStream *out, unsigned int nElem, const char* heapName);
+  void prepare_SizeDistArray(outputStream *out, unsigned int nElem, const char* heapName);
+  void discard_StatArray(outputStream *out);
+  void discard_FreeArray(outputStream *out);
+  void discard_TopSizeArray(outputStream *out);
+  void discard_SizeDistArray(outputStream *out);
+
+  void update_SizeDistArray(outputStream *out, unsigned int len);
+
+  const char* get_heapName();
+  unsigned int findHeapIndex(outputStream *out, const char *heapName);
+  void get_HeapStatGlobals(outputStream *out, const char *heapName);
+  void set_HeapStatGlobals(outputStream *out, const char *heapName);
+
+  void printBox(outputStream* out, const char border, const char* text1, const char* text2);
+  void print_blobType_legend(outputStream *out);
+  void print_space_legend(outputStream *out);
+  void print_age_legend(outputStream *out);
+  void print_blobType_single(outputStream *ast, u2 /* blobType */ type);
+  void print_count_single(outputStream *ast, unsigned short count);
+  void print_space_single(outputStream *ast, unsigned short space);
+  void print_age_single(outputStream *ast, unsigned int age);
+  void print_line_delim(outputStream *out, bufferedStream *sst, unsigned int ix, unsigned int gpl);
+  void print_line_delim(outputStream *out, outputStream *sst, unsigned int ix, unsigned int gpl);
+  blobType get_cbType(CodeBlob* cb);
+
+ public:
+  void discard(outputStream *out);
+  void aggregate(outputStream *out, const char* granularity);
+  void print_usedSpace(outputStream *out);
+  void print_freeSpace(outputStream *out);
+  void print_count(outputStream *out);
+  void print_space(outputStream *out);
+  void print_age(outputStream *out);
+  void print_names(outputStream *out);
+
+  //---<  END  >--- 8198691: CodeHeap State Analytics.
 };
 
 #endif // SHARE_VM_MEMORY_HEAP_HPP
< prev index next >