--- a/hotspot/src/share/vm/services/memoryManager.hpp Thu Jun 10 08:27:35 2010 -0700
+++ b/hotspot/src/share/vm/services/memoryManager.hpp Fri Jul 30 22:43:50 2010 +0100
@@ -131,6 +131,9 @@
return _after_gc_usage_array[pool_index];
}
+ MemoryUsage* before_gc_usage_array() { return _before_gc_usage_array; }
+ MemoryUsage* after_gc_usage_array() { return _after_gc_usage_array; }
+
void set_index(size_t index) { _index = index; }
void set_start_time(jlong time) { _start_time = time; }
void set_end_time(jlong time) { _end_time = time; }
@@ -143,7 +146,7 @@
set_gc_usage(pool_index, usage, false /* after gc */);
}
- void copy_stat(GCStatInfo* stat);
+ void clear();
};
class GCMemoryManager : public MemoryManager {
@@ -153,6 +156,8 @@
elapsedTimer _accumulated_timer;
elapsedTimer _gc_timer; // for measuring every GC duration
GCStatInfo* _last_gc_stat;
+ Mutex* _last_gc_lock;
+ GCStatInfo* _current_gc_stat;
int _num_gc_threads;
public:
GCMemoryManager();
@@ -166,11 +171,16 @@
int num_gc_threads() { return _num_gc_threads; }
void set_num_gc_threads(int count) { _num_gc_threads = count; }
- void gc_begin();
- void gc_end();
+ void gc_begin(bool recordGCBeginTime, bool recordPreGCUsage,
+ bool recordAccumulatedGCTime);
+ void gc_end(bool recordPostGCUsage, bool recordAccumulatedGCTime,
+ bool recordGCEndTime, bool countCollection);
void reset_gc_stat() { _num_collections = 0; _accumulated_timer.reset(); }
- GCStatInfo* last_gc_stat() { return _last_gc_stat; }
+
+ // Copy out _last_gc_stat to the given destination, returning
+ // the collection count. Zero signifies no gc has taken place.
+ size_t get_last_gc_stat(GCStatInfo* dest);
virtual MemoryManager::Name kind() = 0;
};