hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp
changeset 31331 a7c714b6cfb3
parent 31032 8e72621ca186
child 31344 2316eb7a0358
equal deleted inserted replaced
31330:77061bb01b18 31331:a7c714b6cfb3
    29 #include "gc/g1/evacuationInfo.hpp"
    29 #include "gc/g1/evacuationInfo.hpp"
    30 #include "gc/g1/g1AllocRegion.hpp"
    30 #include "gc/g1/g1AllocRegion.hpp"
    31 #include "gc/g1/g1AllocationContext.hpp"
    31 #include "gc/g1/g1AllocationContext.hpp"
    32 #include "gc/g1/g1Allocator.hpp"
    32 #include "gc/g1/g1Allocator.hpp"
    33 #include "gc/g1/g1BiasedArray.hpp"
    33 #include "gc/g1/g1BiasedArray.hpp"
       
    34 #include "gc/g1/g1CollectorState.hpp"
    34 #include "gc/g1/g1HRPrinter.hpp"
    35 #include "gc/g1/g1HRPrinter.hpp"
    35 #include "gc/g1/g1InCSetState.hpp"
    36 #include "gc/g1/g1InCSetState.hpp"
    36 #include "gc/g1/g1MonitoringSupport.hpp"
    37 #include "gc/g1/g1MonitoringSupport.hpp"
    37 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
    38 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
    38 #include "gc/g1/g1YCTypes.hpp"
    39 #include "gc/g1/g1YCTypes.hpp"
   326   // (b) cause == _java_lang_system_gc and +ExplicitGCInvokesConcurrent.
   327   // (b) cause == _java_lang_system_gc and +ExplicitGCInvokesConcurrent.
   327   // (c) cause == _dcmd_gc_run and +ExplicitGCInvokesConcurrent.
   328   // (c) cause == _dcmd_gc_run and +ExplicitGCInvokesConcurrent.
   328   // (d) cause == _g1_humongous_allocation
   329   // (d) cause == _g1_humongous_allocation
   329   bool should_do_concurrent_full_gc(GCCause::Cause cause);
   330   bool should_do_concurrent_full_gc(GCCause::Cause cause);
   330 
   331 
       
   332   // indicates whether we are in young or mixed GC mode
       
   333   G1CollectorState _collector_state;
       
   334 
   331   // Keeps track of how many "old marking cycles" (i.e., Full GCs or
   335   // Keeps track of how many "old marking cycles" (i.e., Full GCs or
   332   // concurrent cycles) we have started.
   336   // concurrent cycles) we have started.
   333   volatile uint _old_marking_cycles_started;
   337   volatile uint _old_marking_cycles_started;
   334 
   338 
   335   // Keeps track of how many "old marking cycles" (i.e., Full GCs or
   339   // Keeps track of how many "old marking cycles" (i.e., Full GCs or
   336   // concurrent cycles) we have completed.
   340   // concurrent cycles) we have completed.
   337   volatile uint _old_marking_cycles_completed;
   341   volatile uint _old_marking_cycles_completed;
   338 
   342 
   339   bool _concurrent_cycle_started;
       
   340   bool _heap_summary_sent;
   343   bool _heap_summary_sent;
   341 
   344 
   342   // This is a non-product method that is helpful for testing. It is
   345   // This is a non-product method that is helpful for testing. It is
   343   // called at the end of a GC and artificially expands the heap by
   346   // called at the end of a GC and artificially expands the heap by
   344   // allocating a number of dead regions. This way we can induce very
   347   // allocating a number of dead regions. This way we can induce very
   699 
   702 
   700   void register_concurrent_cycle_start(const Ticks& start_time);
   703   void register_concurrent_cycle_start(const Ticks& start_time);
   701   void register_concurrent_cycle_end();
   704   void register_concurrent_cycle_end();
   702   void trace_heap_after_concurrent_cycle();
   705   void trace_heap_after_concurrent_cycle();
   703 
   706 
   704   G1YCType yc_type();
       
   705 
       
   706   G1HRPrinter* hr_printer() { return &_hr_printer; }
   707   G1HRPrinter* hr_printer() { return &_hr_printer; }
   707 
   708 
   708   // Frees a non-humongous region by initializing its contents and
   709   // Frees a non-humongous region by initializing its contents and
   709   // adding it to the free list that's passed as a parameter (this is
   710   // adding it to the free list that's passed as a parameter (this is
   710   // usually a local list which will be appended to the master free
   711   // usually a local list which will be appended to the master free
   789   void abandon_collection_set(HeapRegion* cs_head);
   790   void abandon_collection_set(HeapRegion* cs_head);
   790 
   791 
   791   // The concurrent marker (and the thread it runs in.)
   792   // The concurrent marker (and the thread it runs in.)
   792   ConcurrentMark* _cm;
   793   ConcurrentMark* _cm;
   793   ConcurrentMarkThread* _cmThread;
   794   ConcurrentMarkThread* _cmThread;
   794   bool _mark_in_progress;
       
   795 
   795 
   796   // The concurrent refiner.
   796   // The concurrent refiner.
   797   ConcurrentG1Refine* _cg1r;
   797   ConcurrentG1Refine* _cg1r;
   798 
   798 
   799   // The parallel task queues
   799   // The parallel task queues
  1016   void ref_processing_init();
  1016   void ref_processing_init();
  1017 
  1017 
  1018   virtual Name kind() const {
  1018   virtual Name kind() const {
  1019     return CollectedHeap::G1CollectedHeap;
  1019     return CollectedHeap::G1CollectedHeap;
  1020   }
  1020   }
       
  1021 
       
  1022   G1CollectorState* collector_state() { return &_collector_state; }
  1021 
  1023 
  1022   // The current policy object for the collector.
  1024   // The current policy object for the collector.
  1023   G1CollectorPolicy* g1_policy() const { return _g1_policy; }
  1025   G1CollectorPolicy* g1_policy() const { return _g1_policy; }
  1024 
  1026 
  1025   virtual CollectorPolicy* collector_policy() const { return (CollectorPolicy*) g1_policy(); }
  1027   virtual CollectorPolicy* collector_policy() const { return (CollectorPolicy*) g1_policy(); }
  1397   // Set the mod union bits corresponding to the given memRegion.  Note
  1399   // Set the mod union bits corresponding to the given memRegion.  Note
  1398   // that this is always a safe operation, since it doesn't clear any
  1400   // that this is always a safe operation, since it doesn't clear any
  1399   // bits.
  1401   // bits.
  1400   void markModUnionRange(MemRegion mr);
  1402   void markModUnionRange(MemRegion mr);
  1401 
  1403 
  1402   // Records the fact that a marking phase is no longer in progress.
       
  1403   void set_marking_complete() {
       
  1404     _mark_in_progress = false;
       
  1405   }
       
  1406   void set_marking_started() {
       
  1407     _mark_in_progress = true;
       
  1408   }
       
  1409   bool mark_in_progress() {
       
  1410     return _mark_in_progress;
       
  1411   }
       
  1412 
       
  1413   // Print the maximum heap capacity.
  1404   // Print the maximum heap capacity.
  1414   virtual size_t max_capacity() const;
  1405   virtual size_t max_capacity() const;
  1415 
  1406 
  1416   virtual jlong millis_since_last_gc();
  1407   virtual jlong millis_since_last_gc();
  1417 
  1408 
  1519   void parallel_cleaning(BoolObjectClosure* is_alive, bool process_strings, bool process_symbols, bool class_unloading_occurred);
  1510   void parallel_cleaning(BoolObjectClosure* is_alive, bool process_strings, bool process_symbols, bool class_unloading_occurred);
  1520 
  1511 
  1521   // Redirty logged cards in the refinement queue.
  1512   // Redirty logged cards in the refinement queue.
  1522   void redirty_logged_cards();
  1513   void redirty_logged_cards();
  1523   // Verification
  1514   // Verification
  1524 
       
  1525   // The following is just to alert the verification code
       
  1526   // that a full collection has occurred and that the
       
  1527   // remembered sets are no longer up to date.
       
  1528   bool _full_collection;
       
  1529   void set_full_collection() { _full_collection = true;}
       
  1530   void clear_full_collection() {_full_collection = false;}
       
  1531   bool full_collection() {return _full_collection;}
       
  1532 
  1515 
  1533   // Perform any cleanup actions necessary before allowing a verification.
  1516   // Perform any cleanup actions necessary before allowing a verification.
  1534   virtual void prepare_for_verify();
  1517   virtual void prepare_for_verify();
  1535 
  1518 
  1536   // Perform verification.
  1519   // Perform verification.