< prev index next >

src/hotspot/share/services/memoryService.hpp

Print this page
rev 48000 : [mq]: open.patch
rev 48001 : [mq]: 8191564-new.patch


  79 
  80   static MemoryManager* get_memory_manager(int index) {
  81     return _managers_list->at(index);
  82   }
  83 
  84   static void track_memory_usage();
  85   static void track_code_cache_memory_usage() {
  86     // Track memory pool usage of all CodeCache memory pools
  87     for (int i = 0; i < _code_heap_pools->length(); ++i) {
  88       track_memory_pool_usage(_code_heap_pools->at(i));
  89     }
  90   }
  91   static void track_metaspace_memory_usage() {
  92     track_memory_pool_usage(_metaspace_pool);
  93   }
  94   static void track_compressed_class_memory_usage() {
  95     track_memory_pool_usage(_compressed_class_pool);
  96   }
  97   static void track_memory_pool_usage(MemoryPool* pool);
  98 
  99   static void gc_begin(GCMemoryManager* mgr, bool recordGCBeginTime,
 100                        bool recordAccumulatedGCTime,
 101                        bool recordPreGCUsage, bool recordPeakUsage);
 102   static void gc_end(GCMemoryManager* mgr, bool recordPostGCUsage,
 103                      bool recordAccumulatedGCTime,
 104                      bool recordGCEndTime, bool countCollection,
 105                      GCCause::Cause cause);
 106 
 107   static void oops_do(OopClosure* f);
 108 
 109   static bool get_verbose() { return log_is_enabled(Info, gc); }
 110   static bool set_verbose(bool verbose);
 111 
 112   // Create an instance of java/lang/management/MemoryUsage
 113   static Handle create_MemoryUsage_obj(MemoryUsage usage, TRAPS);
 114 };
 115 
 116 class TraceMemoryManagerStats : public StackObj {
 117 private:
 118   GCMemoryManager* _gc_mem_mgr;
 119   bool         _recordGCBeginTime;
 120   bool         _recordPreGCUsage;
 121   bool         _recordPeakUsage;
 122   bool         _recordPostGCUsage;
 123   bool         _recordAccumulatedGCTime;
 124   bool         _recordGCEndTime;
 125   bool         _countCollection;
 126   GCCause::Cause _cause;
 127 public:
 128   TraceMemoryManagerStats() {}
 129   TraceMemoryManagerStats(GCMemoryManager* gc_mem_mgr,
 130                           GCCause::Cause cause,
 131                           bool recordGCBeginTime = true,
 132                           bool recordPreGCUsage = true,
 133                           bool recordPeakUsage = true,
 134                           bool recordPostGCUsage = true,
 135                           bool recordAccumulatedGCTime = true,
 136                           bool recordGCEndTime = true,
 137                           bool countCollection = true);
 138 
 139   void initialize(GCMemoryManager* gc_mem_mgr,
 140                   GCCause::Cause cause,
 141                   bool recordGCBeginTime,
 142                   bool recordPreGCUsage,
 143                   bool recordPeakUsage,
 144                   bool recordPostGCUsage,
 145                   bool recordAccumulatedGCTime,
 146                   bool recordGCEndTime,
 147                   bool countCollection);
 148 
 149   ~TraceMemoryManagerStats();
 150 };
 151 
 152 #endif // SHARE_VM_SERVICES_MEMORYSERVICE_HPP


  79 
  80   static MemoryManager* get_memory_manager(int index) {
  81     return _managers_list->at(index);
  82   }
  83 
  84   static void track_memory_usage();
  85   static void track_code_cache_memory_usage() {
  86     // Track memory pool usage of all CodeCache memory pools
  87     for (int i = 0; i < _code_heap_pools->length(); ++i) {
  88       track_memory_pool_usage(_code_heap_pools->at(i));
  89     }
  90   }
  91   static void track_metaspace_memory_usage() {
  92     track_memory_pool_usage(_metaspace_pool);
  93   }
  94   static void track_compressed_class_memory_usage() {
  95     track_memory_pool_usage(_compressed_class_pool);
  96   }
  97   static void track_memory_pool_usage(MemoryPool* pool);
  98 
  99   static void gc_begin(GCMemoryManager* manager, bool recordGCBeginTime,
 100                        bool recordAccumulatedGCTime,
 101                        bool recordPreGCUsage, bool recordPeakUsage);
 102   static void gc_end(GCMemoryManager* manager, bool recordPostGCUsage,
 103                      bool recordAccumulatedGCTime,
 104                      bool recordGCEndTime, bool countCollection,
 105                      GCCause::Cause cause);
 106 
 107   static void oops_do(OopClosure* f);
 108 
 109   static bool get_verbose() { return log_is_enabled(Info, gc); }
 110   static bool set_verbose(bool verbose);
 111 
 112   // Create an instance of java/lang/management/MemoryUsage
 113   static Handle create_MemoryUsage_obj(MemoryUsage usage, TRAPS);
 114 };
 115 
 116 class TraceMemoryManagerStats : public StackObj {
 117 private:
 118   GCMemoryManager* _gc_memory_manager;
 119   bool         _recordGCBeginTime;
 120   bool         _recordPreGCUsage;
 121   bool         _recordPeakUsage;
 122   bool         _recordPostGCUsage;
 123   bool         _recordAccumulatedGCTime;
 124   bool         _recordGCEndTime;
 125   bool         _countCollection;
 126   GCCause::Cause _cause;
 127 public:
 128   TraceMemoryManagerStats() {}
 129   TraceMemoryManagerStats(GCMemoryManager* gc_memory_manager,
 130                           GCCause::Cause cause,
 131                           bool recordGCBeginTime = true,
 132                           bool recordPreGCUsage = true,
 133                           bool recordPeakUsage = true,
 134                           bool recordPostGCUsage = true,
 135                           bool recordAccumulatedGCTime = true,
 136                           bool recordGCEndTime = true,
 137                           bool countCollection = true);
 138 
 139   void initialize(GCMemoryManager* gc_memory_manager,
 140                   GCCause::Cause cause,
 141                   bool recordGCBeginTime,
 142                   bool recordPreGCUsage,
 143                   bool recordPeakUsage,
 144                   bool recordPostGCUsage,
 145                   bool recordAccumulatedGCTime,
 146                   bool recordGCEndTime,
 147                   bool countCollection);
 148 
 149   ~TraceMemoryManagerStats();
 150 };
 151 
 152 #endif // SHARE_VM_SERVICES_MEMORYSERVICE_HPP
< prev index next >