6797870: Add -XX:+{HeapDump,PrintClassHistogram}{Before,After}FullGC

Call newly created CollectedHeap::dump_{pre,post}_full_gc before and after every stop-world full collection cycle on GenCollectedHeap and ParallelScavengeHeap. (Support for G1CollectedHeap forthcoming under CR 6810861.) Small modifications to existing heap dumping and class histogram implementation, especially to allow multiple on-the-fly histos/dumps by the VM thread during a single safepoint.

Reviewed-by: jmasa, alanb, mchung
This commit is contained in:
Y. Srinivas Ramakrishna 2009-03-02 16:37:04 -08:00
parent dd4aaeadd4
commit 72bfacbd95
15 changed files with 170 additions and 62 deletions

View file

@ -233,7 +233,7 @@ class RecordInstanceClosure : public ObjectClosure {
size_t missed_count() { return _missed_count; }
};
void HeapInspection::heap_inspection(outputStream* st) {
void HeapInspection::heap_inspection(outputStream* st, bool need_prologue) {
ResourceMark rm;
HeapWord* ref;
@ -244,7 +244,9 @@ void HeapInspection::heap_inspection(outputStream* st) {
case CollectedHeap::GenCollectedHeap: {
is_shared_heap = true;
SharedHeap* sh = (SharedHeap*)heap;
sh->gc_prologue(false /* !full */); // get any necessary locks, etc.
if (need_prologue) {
sh->gc_prologue(false /* !full */); // get any necessary locks, etc.
}
ref = sh->perm_gen()->used_region().start();
break;
}
@ -290,7 +292,7 @@ void HeapInspection::heap_inspection(outputStream* st) {
}
st->flush();
if (is_shared_heap) {
if (need_prologue && is_shared_heap) {
SharedHeap* sh = (SharedHeap*)heap;
sh->gc_epilogue(false /* !full */); // release all acquired locks, etc.
}