< prev index next >

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

Print this page
rev 9032 : 8223692: Add JFR G1 Heap Summary Event Support


 358   // called at the end of a GC and artificially expands the heap by
 359   // allocating a number of dead regions. This way we can induce very
 360   // frequent marking cycles and stress the cleanup / concurrent
 361   // cleanup code more (as all the regions that will be allocated by
 362   // this method will be found dead by the marking cycle).
 363   void allocate_dummy_regions() PRODUCT_RETURN;
 364 
 365   // Clear RSets after a compaction. It also resets the GC time stamps.
 366   void clear_rsets_post_compaction();
 367 
 368   // If the HR printer is active, dump the state of the regions in the
 369   // heap after a compaction.
 370   void print_hrm_post_compaction();
 371 
 372   // Create a memory mapper for auxiliary data structures of the given size and
 373   // translation factor.
 374   static G1RegionToSpaceMapper* create_aux_memory_mapper(const char* description,
 375                                                          size_t size,
 376                                                          size_t translation_factor);
 377 


 378   double verify(bool guard, const char* msg);
 379   void verify_before_gc();
 380   void verify_after_gc();
 381 
 382   void log_gc_header();
 383   void log_gc_footer(double pause_time_sec);
 384 
 385   // These are macros so that, if the assert fires, we get the correct
 386   // line number, file, etc.
 387 
 388 #define heap_locking_asserts_err_msg(_extra_message_)                         \
 389   err_msg("%s : Heap_lock locked: %s, at safepoint: %s, is VM thread: %s",    \
 390           (_extra_message_),                                                  \
 391           BOOL_TO_STR(Heap_lock->owned_by_self()),                            \
 392           BOOL_TO_STR(SafepointSynchronize::is_at_safepoint()),               \
 393           BOOL_TO_STR(Thread::current()->is_VM_thread()))
 394 
 395 #define assert_heap_locked()                                                  \
 396   do {                                                                        \
 397     assert(Heap_lock->owned_by_self(),                                        \


1603   // information at the end of remark.
1604   // Currently there is only one place where this is called with
1605   // vo == UseMarkWord, which is to verify the marking during a
1606   // full GC.
1607   void verify(bool silent, VerifyOption vo);
1608 
1609   // Override; it uses the "prev" marking information
1610   virtual void verify(bool silent);
1611 
1612   // The methods below are here for convenience and dispatch the
1613   // appropriate method depending on value of the given VerifyOption
1614   // parameter. The values for that parameter, and their meanings,
1615   // are the same as those above.
1616 
1617   bool is_obj_dead_cond(const oop obj,
1618                         const HeapRegion* hr,
1619                         const VerifyOption vo) const;
1620 
1621   bool is_obj_dead_cond(const oop obj,
1622                         const VerifyOption vo) const;


1623 
1624   // Printing
1625 
1626   virtual void print_on(outputStream* st) const;
1627   virtual void print_extended_on(outputStream* st) const;
1628   virtual void print_on_error(outputStream* st) const;
1629 
1630   virtual void print_gc_threads_on(outputStream* st) const;
1631   virtual void gc_threads_do(ThreadClosure* tc) const;
1632 
1633   // Override
1634   void print_tracing_info() const;
1635 
1636   // The following two methods are helpful for debugging RSet issues.
1637   void print_cset_rsets() PRODUCT_RETURN;
1638   void print_all_rsets() PRODUCT_RETURN;
1639 
1640 public:
1641   size_t pending_card_num();
1642   size_t cards_scanned();


 358   // called at the end of a GC and artificially expands the heap by
 359   // allocating a number of dead regions. This way we can induce very
 360   // frequent marking cycles and stress the cleanup / concurrent
 361   // cleanup code more (as all the regions that will be allocated by
 362   // this method will be found dead by the marking cycle).
 363   void allocate_dummy_regions() PRODUCT_RETURN;
 364 
 365   // Clear RSets after a compaction. It also resets the GC time stamps.
 366   void clear_rsets_post_compaction();
 367 
 368   // If the HR printer is active, dump the state of the regions in the
 369   // heap after a compaction.
 370   void print_hrm_post_compaction();
 371 
 372   // Create a memory mapper for auxiliary data structures of the given size and
 373   // translation factor.
 374   static G1RegionToSpaceMapper* create_aux_memory_mapper(const char* description,
 375                                                          size_t size,
 376                                                          size_t translation_factor);
 377 
 378   void trace_heap(GCWhen::Type when, GCTracer* tracer);
 379 
 380   double verify(bool guard, const char* msg);
 381   void verify_before_gc();
 382   void verify_after_gc();
 383 
 384   void log_gc_header();
 385   void log_gc_footer(double pause_time_sec);
 386 
 387   // These are macros so that, if the assert fires, we get the correct
 388   // line number, file, etc.
 389 
 390 #define heap_locking_asserts_err_msg(_extra_message_)                         \
 391   err_msg("%s : Heap_lock locked: %s, at safepoint: %s, is VM thread: %s",    \
 392           (_extra_message_),                                                  \
 393           BOOL_TO_STR(Heap_lock->owned_by_self()),                            \
 394           BOOL_TO_STR(SafepointSynchronize::is_at_safepoint()),               \
 395           BOOL_TO_STR(Thread::current()->is_VM_thread()))
 396 
 397 #define assert_heap_locked()                                                  \
 398   do {                                                                        \
 399     assert(Heap_lock->owned_by_self(),                                        \


1605   // information at the end of remark.
1606   // Currently there is only one place where this is called with
1607   // vo == UseMarkWord, which is to verify the marking during a
1608   // full GC.
1609   void verify(bool silent, VerifyOption vo);
1610 
1611   // Override; it uses the "prev" marking information
1612   virtual void verify(bool silent);
1613 
1614   // The methods below are here for convenience and dispatch the
1615   // appropriate method depending on value of the given VerifyOption
1616   // parameter. The values for that parameter, and their meanings,
1617   // are the same as those above.
1618 
1619   bool is_obj_dead_cond(const oop obj,
1620                         const HeapRegion* hr,
1621                         const VerifyOption vo) const;
1622 
1623   bool is_obj_dead_cond(const oop obj,
1624                         const VerifyOption vo) const;
1625 
1626   G1HeapSummary create_g1_heap_summary();
1627 
1628   // Printing
1629 
1630   virtual void print_on(outputStream* st) const;
1631   virtual void print_extended_on(outputStream* st) const;
1632   virtual void print_on_error(outputStream* st) const;
1633 
1634   virtual void print_gc_threads_on(outputStream* st) const;
1635   virtual void gc_threads_do(ThreadClosure* tc) const;
1636 
1637   // Override
1638   void print_tracing_info() const;
1639 
1640   // The following two methods are helpful for debugging RSet issues.
1641   void print_cset_rsets() PRODUCT_RETURN;
1642   void print_all_rsets() PRODUCT_RETURN;
1643 
1644 public:
1645   size_t pending_card_num();
1646   size_t cards_scanned();
< prev index next >