Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 1089:db0d5eba9d20
6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
Summary: It introduces the necessary memory pools for G1.
Reviewed-by: mchung, ysr
author | tonyp |
---|---|
date | Fri, 20 Nov 2009 14:47:01 -0500 |
parents | 3fc996d4edd2 |
children | ed52bcc32739 |
comparison
equal
deleted
inserted
replaced
1088:3fc996d4edd2 | 1089:db0d5eba9d20 |
---|---|
926 // Timing | 926 // Timing |
927 gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); | 927 gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); |
928 TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); | 928 TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); |
929 TraceTime t(full ? "Full GC (System.gc())" : "Full GC", PrintGC, true, gclog_or_tty); | 929 TraceTime t(full ? "Full GC (System.gc())" : "Full GC", PrintGC, true, gclog_or_tty); |
930 | 930 |
931 TraceMemoryManagerStats tms(true /* fullGC */); | |
932 | |
931 double start = os::elapsedTime(); | 933 double start = os::elapsedTime(); |
932 g1_policy()->record_full_collection_start(); | 934 g1_policy()->record_full_collection_start(); |
933 | 935 |
934 gc_prologue(true); | 936 gc_prologue(true); |
935 increment_total_collections(true /* full gc */); | 937 increment_total_collections(true /* full gc */); |
998 _summary_bytes_used = recalculate_used(); | 1000 _summary_bytes_used = recalculate_used(); |
999 | 1001 |
1000 ref_processor()->enqueue_discovered_references(); | 1002 ref_processor()->enqueue_discovered_references(); |
1001 | 1003 |
1002 COMPILER2_PRESENT(DerivedPointerTable::update_pointers()); | 1004 COMPILER2_PRESENT(DerivedPointerTable::update_pointers()); |
1005 | |
1006 MemoryService::track_memory_usage(); | |
1003 | 1007 |
1004 if (VerifyAfterGC && total_collections() >= VerifyGCStartAt) { | 1008 if (VerifyAfterGC && total_collections() >= VerifyGCStartAt) { |
1005 HandleMark hm; // Discard invalid handles created during verification | 1009 HandleMark hm; // Discard invalid handles created during verification |
1006 gclog_or_tty->print(" VerifyAfterGC:"); | 1010 gclog_or_tty->print(" VerifyAfterGC:"); |
1007 prepare_for_verify(); | 1011 prepare_for_verify(); |
2643 if (PrintHeapAtGC) { | 2647 if (PrintHeapAtGC) { |
2644 Universe::print_heap_before_gc(); | 2648 Universe::print_heap_before_gc(); |
2645 } | 2649 } |
2646 | 2650 |
2647 { | 2651 { |
2652 ResourceMark rm; | |
2653 | |
2648 char verbose_str[128]; | 2654 char verbose_str[128]; |
2649 sprintf(verbose_str, "GC pause "); | 2655 sprintf(verbose_str, "GC pause "); |
2650 if (g1_policy()->in_young_gc_mode()) { | 2656 if (g1_policy()->in_young_gc_mode()) { |
2651 if (g1_policy()->full_young_gcs()) | 2657 if (g1_policy()->full_young_gcs()) |
2652 strcat(verbose_str, "(young)"); | 2658 strcat(verbose_str, "(young)"); |
2661 // is messy if we do. | 2667 // is messy if we do. |
2662 gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); | 2668 gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); |
2663 TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); | 2669 TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); |
2664 TraceTime t(verbose_str, PrintGC && !PrintGCDetails, true, gclog_or_tty); | 2670 TraceTime t(verbose_str, PrintGC && !PrintGCDetails, true, gclog_or_tty); |
2665 | 2671 |
2666 ResourceMark rm; | 2672 TraceMemoryManagerStats tms(false /* fullGC */); |
2673 | |
2667 assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); | 2674 assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); |
2668 assert(Thread::current() == VMThread::vm_thread(), "should be in vm thread"); | 2675 assert(Thread::current() == VMThread::vm_thread(), "should be in vm thread"); |
2669 guarantee(!is_gc_active(), "collection is not reentrant"); | 2676 guarantee(!is_gc_active(), "collection is not reentrant"); |
2670 assert(regions_accounted_for(), "Region leakage!"); | 2677 assert(regions_accounted_for(), "Region leakage!"); |
2671 | 2678 |
2856 double pause_time_ms = (end_time_sec - start_time_sec) * MILLIUNITS; | 2863 double pause_time_ms = (end_time_sec - start_time_sec) * MILLIUNITS; |
2857 g1_policy()->record_pause_time_ms(pause_time_ms); | 2864 g1_policy()->record_pause_time_ms(pause_time_ms); |
2858 g1_policy()->record_collection_pause_end(abandoned); | 2865 g1_policy()->record_collection_pause_end(abandoned); |
2859 | 2866 |
2860 assert(regions_accounted_for(), "Region leakage."); | 2867 assert(regions_accounted_for(), "Region leakage."); |
2868 | |
2869 MemoryService::track_memory_usage(); | |
2861 | 2870 |
2862 if (VerifyAfterGC && total_collections() >= VerifyGCStartAt) { | 2871 if (VerifyAfterGC && total_collections() >= VerifyGCStartAt) { |
2863 HandleMark hm; // Discard invalid handles created during verification | 2872 HandleMark hm; // Discard invalid handles created during verification |
2864 gclog_or_tty->print(" VerifyAfterGC:"); | 2873 gclog_or_tty->print(" VerifyAfterGC:"); |
2865 prepare_for_verify(); | 2874 prepare_for_verify(); |