< prev index next >

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

Print this page
rev 7618 : 8062063: Usage of UseHugeTLBFS, UseLargePagesInMetaspace and huge SurvivorAlignmentInBytes cause crashes in CMBitMapClosure::do_bit
Summary: Making sure committed memory is cleared when re-committed, even if using large pages.
Reviewed-by:
rev 7619 : [mq]: clear-in-listener
rev 7620 : [mq]: needs-zeroing-to-dirty


  32 
  33 // Virtual space management helper for a virtual space with an OS page allocation
  34 // granularity.
  35 // (De-)Allocation requests are always OS page aligned by passing a page index
  36 // and multiples of pages.
  37 // The implementation gives an error when trying to commit or uncommit pages that
  38 // have already been committed or uncommitted.
  39 class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC {
  40   friend class VMStructs;
  41  private:
  42   // Reserved area addresses.
  43   char* _low_boundary;
  44   char* _high_boundary;
  45 
  46   // The commit/uncommit granularity in bytes.
  47   size_t _page_size;
  48 
  49   // Bitmap used for verification of commit/uncommit operations.
  50   BitMap _committed;
  51 
  52   // For _special spaces we need to keep track if the memory needs to be zeroed
  53   // after commit or not.
  54   BitMap _needs_zeroing;


  55 
  56   // Indicates that the entire space has been committed and pinned in memory,
  57   // os::commit_memory() or os::uncommit_memory() have no function.
  58   bool _special;
  59 
  60   // Indicates whether the committed space should be executable.
  61   bool _executable;
  62 
  63   // Returns the index of the page which contains the given address.
  64   uintptr_t  addr_to_page_index(char* addr) const;
  65   // Returns the address of the given page index.
  66   char*  page_start(uintptr_t index);
  67   // Returns the byte size of the given number of pages.
  68   size_t byte_size_for_pages(size_t num);
  69 
  70   // Returns true if the entire area is backed by committed memory.
  71   bool is_area_committed(uintptr_t start, size_t size_in_pages) const;
  72   // Returns true if the entire area is not backed by committed memory.
  73   bool is_area_uncommitted(uintptr_t start, size_t size_in_pages) const;
  74 




  32 
  33 // Virtual space management helper for a virtual space with an OS page allocation
  34 // granularity.
  35 // (De-)Allocation requests are always OS page aligned by passing a page index
  36 // and multiples of pages.
  37 // The implementation gives an error when trying to commit or uncommit pages that
  38 // have already been committed or uncommitted.
  39 class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC {
  40   friend class VMStructs;
  41  private:
  42   // Reserved area addresses.
  43   char* _low_boundary;
  44   char* _high_boundary;
  45 
  46   // The commit/uncommit granularity in bytes.
  47   size_t _page_size;
  48 
  49   // Bitmap used for verification of commit/uncommit operations.
  50   BitMap _committed;
  51 
  52   // Bitmap used to keep track of which pages are dirty or not for _special
  53   // spaces. This is needed because for those spaces the underlying memory
  54   // will only be zero filled the first time it is committed. Calls to commit
  55   // will use this bitmap and return whether or not the memory is zero filled.
  56   BitMap _dirty;
  57 
  58   // Indicates that the entire space has been committed and pinned in memory,
  59   // os::commit_memory() or os::uncommit_memory() have no function.
  60   bool _special;
  61 
  62   // Indicates whether the committed space should be executable.
  63   bool _executable;
  64 
  65   // Returns the index of the page which contains the given address.
  66   uintptr_t  addr_to_page_index(char* addr) const;
  67   // Returns the address of the given page index.
  68   char*  page_start(uintptr_t index);
  69   // Returns the byte size of the given number of pages.
  70   size_t byte_size_for_pages(size_t num);
  71 
  72   // Returns true if the entire area is backed by committed memory.
  73   bool is_area_committed(uintptr_t start, size_t size_in_pages) const;
  74   // Returns true if the entire area is not backed by committed memory.
  75   bool is_area_uncommitted(uintptr_t start, size_t size_in_pages) const;
  76 


< prev index next >