< prev index next >

src/hotspot/share/gc/parallel/adjoiningGenerationsForHeteroHeap.hpp

Print this page
rev 52626 : webrev.03
rev 52627 : some comments from Sangheon


  24 
  25 #ifndef SHARE_VM_GC_PARALLEL_ADJOININGGENERATIONSFORHETEROHEAP_HPP
  26 #define SHARE_VM_GC_PARALLEL_ADJOININGGENERATIONSFORHETEROHEAP_HPP
  27 
  28 #include "gc/parallel/adjoiningGenerations.hpp"
  29 
  30 class AdjoiningGenerationsForHeteroHeap : public AdjoiningGenerations {
  31   friend class VMStructs;
  32 private:
  33   // Maximum total size of the generations. This is equal to the heap size specified by user.
  34   // When adjusting young and old generation sizes, we need ensure that sum of the generation sizes does not exceed this.
  35   size_t _total_size_limit;
  36 
  37   size_t total_size_limit() const {
  38     return _total_size_limit;
  39   }
  40 
  41   // HeteroVirtualSpaces creates non-overlapping virtual spaces. Here _low and _high do not share a reserved space, i.e. there is no boundary
  42   // separating the two virtual spaces.
  43   class HeteroVirtualSpaces : public AdjoiningVirtualSpaces {

  44     size_t _min_old_byte_size;
  45     size_t _min_young_byte_size;
  46     size_t _max_old_byte_size;
  47     size_t _max_young_byte_size;
  48     size_t _max_total_size;
  49 
  50     // Internally we access the virtual spaces using these methods. It increases readability, since we were not really 
  51     // dealing with adjoining virtual spaces separated by a boundary as is the case in base class.
  52     // Externally they are accessed using low() and high() methods of base class.
  53     PSVirtualSpace* young_vs() { return high(); }
  54     PSVirtualSpace* old_vs() { return low(); }
  55 
  56   public:
  57     HeteroVirtualSpaces(ReservedSpace rs,
  58                         size_t min_old_byte_size,
  59                         size_t min_young_byte_size, size_t max_total_size,
  60                         size_t alignment);
  61 
  62     // Increase old generation size and decrease young generation size by same amount
  63     bool adjust_boundary_up(size_t size_in_bytes);
  64     // Increase young generation size and decrease old generation size by same amount
  65     bool adjust_boundary_down(size_t size_in_bytes);
  66 
  67     size_t max_young_size() const { return _max_young_byte_size; }
  68     size_t max_old_size() const { return _max_old_byte_size; }


  24 
  25 #ifndef SHARE_VM_GC_PARALLEL_ADJOININGGENERATIONSFORHETEROHEAP_HPP
  26 #define SHARE_VM_GC_PARALLEL_ADJOININGGENERATIONSFORHETEROHEAP_HPP
  27 
  28 #include "gc/parallel/adjoiningGenerations.hpp"
  29 
  30 class AdjoiningGenerationsForHeteroHeap : public AdjoiningGenerations {
  31   friend class VMStructs;
  32 private:
  33   // Maximum total size of the generations. This is equal to the heap size specified by user.
  34   // When adjusting young and old generation sizes, we need ensure that sum of the generation sizes does not exceed this.
  35   size_t _total_size_limit;
  36 
  37   size_t total_size_limit() const {
  38     return _total_size_limit;
  39   }
  40 
  41   // HeteroVirtualSpaces creates non-overlapping virtual spaces. Here _low and _high do not share a reserved space, i.e. there is no boundary
  42   // separating the two virtual spaces.
  43   class HeteroVirtualSpaces : public AdjoiningVirtualSpaces {
  44     size_t _max_total_size;
  45     size_t _min_old_byte_size;
  46     size_t _min_young_byte_size;
  47     size_t _max_old_byte_size;
  48     size_t _max_young_byte_size;

  49 
  50     // Internally we access the virtual spaces using these methods. It increases readability, since we were not really 
  51     // dealing with adjoining virtual spaces separated by a boundary as is the case in base class.
  52     // Externally they are accessed using low() and high() methods of base class.
  53     PSVirtualSpace* young_vs() { return high(); }
  54     PSVirtualSpace* old_vs() { return low(); }
  55 
  56   public:
  57     HeteroVirtualSpaces(ReservedSpace rs,
  58                         size_t min_old_byte_size,
  59                         size_t min_young_byte_size, size_t max_total_size,
  60                         size_t alignment);
  61 
  62     // Increase old generation size and decrease young generation size by same amount
  63     bool adjust_boundary_up(size_t size_in_bytes);
  64     // Increase young generation size and decrease old generation size by same amount
  65     bool adjust_boundary_down(size_t size_in_bytes);
  66 
  67     size_t max_young_size() const { return _max_young_byte_size; }
  68     size_t max_old_size() const { return _max_old_byte_size; }
< prev index next >