hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp
changeset 34241 78486dc87f38
parent 33789 4a76a42bd42e
child 34298 f3c9dcc5af96
child 34296 ef50f39866b5
equal deleted inserted replaced
34240:62db4b48cbef 34241:78486dc87f38
   469   HeapRegion* new_gc_alloc_region(size_t word_size, uint count,
   469   HeapRegion* new_gc_alloc_region(size_t word_size, uint count,
   470                                   InCSetState dest);
   470                                   InCSetState dest);
   471   void retire_gc_alloc_region(HeapRegion* alloc_region,
   471   void retire_gc_alloc_region(HeapRegion* alloc_region,
   472                               size_t allocated_bytes, InCSetState dest);
   472                               size_t allocated_bytes, InCSetState dest);
   473 
   473 
   474   // - if explicit_gc is true, the GC is for a System.gc() or a heap
   474   // - if explicit_gc is true, the GC is for a System.gc() etc,
   475   //   inspection request and should collect the entire heap
   475   //   otherwise it's for a failed allocation.
   476   // - if clear_all_soft_refs is true, all soft references should be
   476   // - if clear_all_soft_refs is true, all soft references should be
   477   //   cleared during the GC
   477   //   cleared during the GC.
   478   // - if explicit_gc is false, word_size describes the allocation that
       
   479   //   the GC should attempt (at least) to satisfy
       
   480   // - it returns false if it is unable to do the collection due to the
   478   // - it returns false if it is unable to do the collection due to the
   481   //   GC locker being active, true otherwise
   479   //   GC locker being active, true otherwise.
   482   bool do_collection(bool explicit_gc,
   480   bool do_full_collection(bool explicit_gc,
   483                      bool clear_all_soft_refs,
   481                           bool clear_all_soft_refs);
   484                      size_t word_size);
   482 
   485 
   483   // Callback from VM_G1CollectFull operation, or collect_as_vm_thread.
   486   // Callback from VM_G1CollectFull operation.
       
   487   // Perform a full collection.
       
   488   virtual void do_full_collection(bool clear_all_soft_refs);
   484   virtual void do_full_collection(bool clear_all_soft_refs);
   489 
   485 
   490   // Resize the heap if necessary after a full collection.  If this is
   486   // Resize the heap if necessary after a full collection.
   491   // after a collect-for allocation, "word_size" is the allocation size,
   487   void resize_if_necessary_after_full_collection();
   492   // and will be considered part of the used portion of the heap.
       
   493   void resize_if_necessary_after_full_collection(size_t word_size);
       
   494 
   488 
   495   // Callback from VM_G1CollectForAllocation operation.
   489   // Callback from VM_G1CollectForAllocation operation.
   496   // This function does everything necessary/possible to satisfy a
   490   // This function does everything necessary/possible to satisfy a
   497   // failed allocation request (including collection, expansion, etc.)
   491   // failed allocation request (including collection, expansion, etc.)
   498   HeapWord* satisfy_failed_allocation(size_t word_size,
   492   HeapWord* satisfy_failed_allocation(size_t word_size,
  1148   // Perform a collection of the heap; intended for use in implementing
  1142   // Perform a collection of the heap; intended for use in implementing
  1149   // "System.gc".  This probably implies as full a collection as the
  1143   // "System.gc".  This probably implies as full a collection as the
  1150   // "CollectedHeap" supports.
  1144   // "CollectedHeap" supports.
  1151   virtual void collect(GCCause::Cause cause);
  1145   virtual void collect(GCCause::Cause cause);
  1152 
  1146 
  1153   // The same as above but assume that the caller holds the Heap_lock.
       
  1154   void collect_locked(GCCause::Cause cause);
       
  1155 
       
  1156   virtual bool copy_allocation_context_stats(const jint* contexts,
  1147   virtual bool copy_allocation_context_stats(const jint* contexts,
  1157                                              jlong* totals,
  1148                                              jlong* totals,
  1158                                              jbyte* accuracy,
  1149                                              jbyte* accuracy,
  1159                                              jint len);
  1150                                              jint len);
  1160 
  1151 
  1350   // Returns the humongous threshold for a specific region size
  1341   // Returns the humongous threshold for a specific region size
  1351   static size_t humongous_threshold_for(size_t region_size) {
  1342   static size_t humongous_threshold_for(size_t region_size) {
  1352     return (region_size / 2);
  1343     return (region_size / 2);
  1353   }
  1344   }
  1354 
  1345 
  1355   // Update mod union table with the set of dirty cards.
       
  1356   void updateModUnion();
       
  1357 
       
  1358   // Set the mod union bits corresponding to the given memRegion.  Note
       
  1359   // that this is always a safe operation, since it doesn't clear any
       
  1360   // bits.
       
  1361   void markModUnionRange(MemRegion mr);
       
  1362 
       
  1363   // Print the maximum heap capacity.
  1346   // Print the maximum heap capacity.
  1364   virtual size_t max_capacity() const;
  1347   virtual size_t max_capacity() const;
  1365 
  1348 
  1366   virtual jlong millis_since_last_gc();
  1349   virtual jlong millis_since_last_gc();
  1367 
  1350