< prev index next >

src/hotspot/share/gc/g1/g1MonitoringSupport.hpp

Print this page




 157   HSpaceCounters*      _to_space_counters;
 158 
 159   // When it's appropriate to recalculate the various sizes (at the
 160   // end of a GC, when a new eden region is allocated, etc.) we store
 161   // them here so that we can easily report them when needed and not
 162   // have to recalculate them every time.
 163 
 164   size_t _overall_committed;
 165   size_t _overall_used;
 166 
 167   size_t _young_gen_committed;
 168   size_t _old_gen_committed;
 169 
 170   size_t _eden_space_committed;
 171   size_t _eden_space_used;
 172   size_t _survivor_space_committed;
 173   size_t _survivor_space_used;
 174 
 175   size_t _old_gen_used;
 176 















 177   // Recalculate all the sizes.
 178   void recalculate_sizes();
 179 
 180   void recalculate_eden_size();
 181 
 182 public:
 183   G1MonitoringSupport(G1CollectedHeap* g1h);
 184   ~G1MonitoringSupport();
 185 
 186   void initialize_serviceability();
 187 
 188   MemoryUsage memory_usage();
 189   GrowableArray<GCMemoryManager*> memory_managers();
 190   GrowableArray<MemoryPool*> memory_pools();
 191 
 192   // Unfortunately, the jstat tool assumes that no space has 0
 193   // capacity. In our case, given that each space is logical, it's
 194   // possible that no regions will be allocated to it, hence to have 0
 195   // capacity (e.g., if there are no survivor regions, the survivor
 196   // space has 0 capacity). The way we deal with this is to always pad




 157   HSpaceCounters*      _to_space_counters;
 158 
 159   // When it's appropriate to recalculate the various sizes (at the
 160   // end of a GC, when a new eden region is allocated, etc.) we store
 161   // them here so that we can easily report them when needed and not
 162   // have to recalculate them every time.
 163 
 164   size_t _overall_committed;
 165   size_t _overall_used;
 166 
 167   size_t _young_gen_committed;
 168   size_t _old_gen_committed;
 169 
 170   size_t _eden_space_committed;
 171   size_t _eden_space_used;
 172   size_t _survivor_space_committed;
 173   size_t _survivor_space_used;
 174 
 175   size_t _old_gen_used;
 176 
 177   // It returns x - y if x > y, 0 otherwise.
 178   // As described in the comment above, some of the inputs to the
 179   // calculations we have to do are obtained concurrently and hence
 180   // may be inconsistent with each other. So, this provides a
 181   // defensive way of performing the subtraction and avoids the value
 182   // going negative (which would mean a very large result, given that
 183   // the parameter are size_t).
 184   static size_t subtract_up_to_zero(size_t x, size_t y) {
 185     if (x > y) {
 186       return x - y;
 187     } else {
 188       return 0;
 189     }
 190   }
 191 
 192   // Recalculate all the sizes.
 193   void recalculate_sizes();
 194 
 195   void recalculate_eden_size();
 196 
 197 public:
 198   G1MonitoringSupport(G1CollectedHeap* g1h);
 199   ~G1MonitoringSupport();
 200 
 201   void initialize_serviceability();
 202 
 203   MemoryUsage memory_usage();
 204   GrowableArray<GCMemoryManager*> memory_managers();
 205   GrowableArray<MemoryPool*> memory_pools();
 206 
 207   // Unfortunately, the jstat tool assumes that no space has 0
 208   // capacity. In our case, given that each space is logical, it's
 209   // possible that no regions will be allocated to it, hence to have 0
 210   // capacity (e.g., if there are no survivor regions, the survivor
 211   // space has 0 capacity). The way we deal with this is to always pad


< prev index next >