< prev index next >

src/share/vm/gc/g1/concurrentMark.hpp

Print this page




1043     assert(new_finger >= _finger && new_finger < _region_limit, "invariant");
1044     _finger = new_finger;
1045   }
1046 
1047   CMTask(uint worker_id,
1048          ConcurrentMark *cm,
1049          size_t* marked_bytes,
1050          BitMap* card_bm,
1051          CMTaskQueue* task_queue,
1052          CMTaskQueueSet* task_queues);
1053 
1054   // it prints statistics associated with this task
1055   void print_stats();
1056 };
1057 
1058 // Class that's used to to print out per-region liveness
1059 // information. It's currently used at the end of marking and also
1060 // after we sort the old regions at the end of the cleanup operation.
1061 class G1PrintRegionLivenessInfoClosure: public HeapRegionClosure {
1062 private:
1063   outputStream* _out;
1064 
1065   // Accumulators for these values.
1066   size_t _total_used_bytes;
1067   size_t _total_capacity_bytes;
1068   size_t _total_prev_live_bytes;
1069   size_t _total_next_live_bytes;
1070 
1071   // These are set up when we come across a "stars humongous" region
1072   // (as this is where most of this information is stored, not in the
1073   // subsequent "continues humongous" regions). After that, for every
1074   // region in a given humongous region series we deduce the right
1075   // values for it by simply subtracting the appropriate amount from
1076   // these fields. All these values should reach 0 after we've visited
1077   // the last region in the series.
1078   size_t _hum_used_bytes;
1079   size_t _hum_capacity_bytes;
1080   size_t _hum_prev_live_bytes;
1081   size_t _hum_next_live_bytes;
1082 
1083   // Accumulator for the remembered set size
1084   size_t _total_remset_bytes;


1089   static double perc(size_t val, size_t total) {
1090     if (total == 0) {
1091       return 0.0;
1092     } else {
1093       return 100.0 * ((double) val / (double) total);
1094     }
1095   }
1096 
1097   static double bytes_to_mb(size_t val) {
1098     return (double) val / (double) M;
1099   }
1100 
1101   // See the .cpp file.
1102   size_t get_hum_bytes(size_t* hum_bytes);
1103   void get_hum_bytes(size_t* used_bytes, size_t* capacity_bytes,
1104                      size_t* prev_live_bytes, size_t* next_live_bytes);
1105 
1106 public:
1107   // The header and footer are printed in the constructor and
1108   // destructor respectively.
1109   G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name);
1110   virtual bool doHeapRegion(HeapRegion* r);
1111   ~G1PrintRegionLivenessInfoClosure();
1112 };
1113 
1114 #endif // SHARE_VM_GC_G1_CONCURRENTMARK_HPP


1043     assert(new_finger >= _finger && new_finger < _region_limit, "invariant");
1044     _finger = new_finger;
1045   }
1046 
1047   CMTask(uint worker_id,
1048          ConcurrentMark *cm,
1049          size_t* marked_bytes,
1050          BitMap* card_bm,
1051          CMTaskQueue* task_queue,
1052          CMTaskQueueSet* task_queues);
1053 
1054   // it prints statistics associated with this task
1055   void print_stats();
1056 };
1057 
1058 // Class that's used to to print out per-region liveness
1059 // information. It's currently used at the end of marking and also
1060 // after we sort the old regions at the end of the cleanup operation.
1061 class G1PrintRegionLivenessInfoClosure: public HeapRegionClosure {
1062 private:


1063   // Accumulators for these values.
1064   size_t _total_used_bytes;
1065   size_t _total_capacity_bytes;
1066   size_t _total_prev_live_bytes;
1067   size_t _total_next_live_bytes;
1068 
1069   // These are set up when we come across a "stars humongous" region
1070   // (as this is where most of this information is stored, not in the
1071   // subsequent "continues humongous" regions). After that, for every
1072   // region in a given humongous region series we deduce the right
1073   // values for it by simply subtracting the appropriate amount from
1074   // these fields. All these values should reach 0 after we've visited
1075   // the last region in the series.
1076   size_t _hum_used_bytes;
1077   size_t _hum_capacity_bytes;
1078   size_t _hum_prev_live_bytes;
1079   size_t _hum_next_live_bytes;
1080 
1081   // Accumulator for the remembered set size
1082   size_t _total_remset_bytes;


1087   static double perc(size_t val, size_t total) {
1088     if (total == 0) {
1089       return 0.0;
1090     } else {
1091       return 100.0 * ((double) val / (double) total);
1092     }
1093   }
1094 
1095   static double bytes_to_mb(size_t val) {
1096     return (double) val / (double) M;
1097   }
1098 
1099   // See the .cpp file.
1100   size_t get_hum_bytes(size_t* hum_bytes);
1101   void get_hum_bytes(size_t* used_bytes, size_t* capacity_bytes,
1102                      size_t* prev_live_bytes, size_t* next_live_bytes);
1103 
1104 public:
1105   // The header and footer are printed in the constructor and
1106   // destructor respectively.
1107   G1PrintRegionLivenessInfoClosure(const char* phase_name);
1108   virtual bool doHeapRegion(HeapRegion* r);
1109   ~G1PrintRegionLivenessInfoClosure();
1110 };
1111 
1112 #endif // SHARE_VM_GC_G1_CONCURRENTMARK_HPP
< prev index next >