1.1 --- a/src/share/vm/services/memoryManager.hpp Thu Jun 10 08:27:35 2010 -0700 1.2 +++ b/src/share/vm/services/memoryManager.hpp Fri Jul 30 22:43:50 2010 +0100 1.3 @@ -131,6 +131,9 @@ 1.4 return _after_gc_usage_array[pool_index]; 1.5 } 1.6 1.7 + MemoryUsage* before_gc_usage_array() { return _before_gc_usage_array; } 1.8 + MemoryUsage* after_gc_usage_array() { return _after_gc_usage_array; } 1.9 + 1.10 void set_index(size_t index) { _index = index; } 1.11 void set_start_time(jlong time) { _start_time = time; } 1.12 void set_end_time(jlong time) { _end_time = time; } 1.13 @@ -143,7 +146,7 @@ 1.14 set_gc_usage(pool_index, usage, false /* after gc */); 1.15 } 1.16 1.17 - void copy_stat(GCStatInfo* stat); 1.18 + void clear(); 1.19 }; 1.20 1.21 class GCMemoryManager : public MemoryManager { 1.22 @@ -153,6 +156,8 @@ 1.23 elapsedTimer _accumulated_timer; 1.24 elapsedTimer _gc_timer; // for measuring every GC duration 1.25 GCStatInfo* _last_gc_stat; 1.26 + Mutex* _last_gc_lock; 1.27 + GCStatInfo* _current_gc_stat; 1.28 int _num_gc_threads; 1.29 public: 1.30 GCMemoryManager(); 1.31 @@ -166,11 +171,16 @@ 1.32 int num_gc_threads() { return _num_gc_threads; } 1.33 void set_num_gc_threads(int count) { _num_gc_threads = count; } 1.34 1.35 - void gc_begin(); 1.36 - void gc_end(); 1.37 + void gc_begin(bool recordGCBeginTime, bool recordPreGCUsage, 1.38 + bool recordAccumulatedGCTime); 1.39 + void gc_end(bool recordPostGCUsage, bool recordAccumulatedGCTime, 1.40 + bool recordGCEndTime, bool countCollection); 1.41 1.42 void reset_gc_stat() { _num_collections = 0; _accumulated_timer.reset(); } 1.43 - GCStatInfo* last_gc_stat() { return _last_gc_stat; } 1.44 + 1.45 + // Copy out _last_gc_stat to the given destination, returning 1.46 + // the collection count. Zero signifies no gc has taken place. 1.47 + size_t get_last_gc_stat(GCStatInfo* dest); 1.48 1.49 virtual MemoryManager::Name kind() = 0; 1.50 };