src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hs-gc-g1-gc-timestamp Sdiff src/share/vm/gc_implementation/g1

src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp

Print this page
rev 3618 : 7198130: G1: PrintReferenceGC output comes out of order
Summary: Move the first part of the GC logging, including timestamp, to the start of the GC
Reviewed-by: johnc


 391 
 392   // This is a non-product method that is helpful for testing. It is
 393   // called at the end of a GC and artificially expands the heap by
 394   // allocating a number of dead regions. This way we can induce very
 395   // frequent marking cycles and stress the cleanup / concurrent
 396   // cleanup code more (as all the regions that will be allocated by
 397   // this method will be found dead by the marking cycle).
 398   void allocate_dummy_regions() PRODUCT_RETURN;
 399 
 400   // Clear RSets after a compaction. It also resets the GC time stamps.
 401   void clear_rsets_post_compaction();
 402 
 403   // If the HR printer is active, dump the state of the regions in the
 404   // heap after a compaction.
 405   void print_hrs_post_compaction();
 406 
 407   double verify(bool guard, const char* msg);
 408   void verify_before_gc();
 409   void verify_after_gc();
 410 



 411   // These are macros so that, if the assert fires, we get the correct
 412   // line number, file, etc.
 413 
 414 #define heap_locking_asserts_err_msg(_extra_message_)                         \
 415   err_msg("%s : Heap_lock locked: %s, at safepoint: %s, is VM thread: %s",    \
 416           (_extra_message_),                                                  \
 417           BOOL_TO_STR(Heap_lock->owned_by_self()),                            \
 418           BOOL_TO_STR(SafepointSynchronize::is_at_safepoint()),               \
 419           BOOL_TO_STR(Thread::current()->is_VM_thread()))
 420 
 421 #define assert_heap_locked()                                                  \
 422   do {                                                                        \
 423     assert(Heap_lock->owned_by_self(),                                        \
 424            heap_locking_asserts_err_msg("should be holding the Heap_lock"));  \
 425   } while (0)
 426 
 427 #define assert_heap_locked_or_at_safepoint(_should_be_vm_thread_)             \
 428   do {                                                                        \
 429     assert(Heap_lock->owned_by_self() ||                                      \
 430            (SafepointSynchronize::is_at_safepoint() &&                        \




 391 
 392   // This is a non-product method that is helpful for testing. It is
 393   // called at the end of a GC and artificially expands the heap by
 394   // allocating a number of dead regions. This way we can induce very
 395   // frequent marking cycles and stress the cleanup / concurrent
 396   // cleanup code more (as all the regions that will be allocated by
 397   // this method will be found dead by the marking cycle).
 398   void allocate_dummy_regions() PRODUCT_RETURN;
 399 
 400   // Clear RSets after a compaction. It also resets the GC time stamps.
 401   void clear_rsets_post_compaction();
 402 
 403   // If the HR printer is active, dump the state of the regions in the
 404   // heap after a compaction.
 405   void print_hrs_post_compaction();
 406 
 407   double verify(bool guard, const char* msg);
 408   void verify_before_gc();
 409   void verify_after_gc();
 410 
 411   void log_gc_header();
 412   void log_gc_footer(double pause_time_sec);
 413 
 414   // These are macros so that, if the assert fires, we get the correct
 415   // line number, file, etc.
 416 
 417 #define heap_locking_asserts_err_msg(_extra_message_)                         \
 418   err_msg("%s : Heap_lock locked: %s, at safepoint: %s, is VM thread: %s",    \
 419           (_extra_message_),                                                  \
 420           BOOL_TO_STR(Heap_lock->owned_by_self()),                            \
 421           BOOL_TO_STR(SafepointSynchronize::is_at_safepoint()),               \
 422           BOOL_TO_STR(Thread::current()->is_VM_thread()))
 423 
 424 #define assert_heap_locked()                                                  \
 425   do {                                                                        \
 426     assert(Heap_lock->owned_by_self(),                                        \
 427            heap_locking_asserts_err_msg("should be holding the Heap_lock"));  \
 428   } while (0)
 429 
 430 #define assert_heap_locked_or_at_safepoint(_should_be_vm_thread_)             \
 431   do {                                                                        \
 432     assert(Heap_lock->owned_by_self() ||                                      \
 433            (SafepointSynchronize::is_at_safepoint() &&                        \


src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File