< prev index next >

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

Print this page




  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/parallel/adjoiningGenerationsForHeteroHeap.hpp"
  27 #include "gc/parallel/adjoiningVirtualSpaces.hpp"
  28 #include "gc/parallel/parallelArguments.hpp"
  29 #include "gc/parallel/parallelScavengeHeap.hpp"
  30 #include "gc/parallel/psFileBackedVirtualspace.hpp"
  31 #include "logging/log.hpp"
  32 #include "logging/logStream.hpp"
  33 #include "memory/resourceArea.hpp"
  34 #include "utilities/align.hpp"
  35 #include "utilities/ostream.hpp"
  36 
  37 // Create two virtual spaces (HeteroVirtualSpaces), low() on nv-dimm memory, high() on dram.
  38 // create ASPSOldGen and ASPSYoungGen the same way as in base class
  39 
  40 AdjoiningGenerationsForHeteroHeap::AdjoiningGenerationsForHeteroHeap(ReservedSpace old_young_rs) :
  41   _total_size_limit(ParallelArguments::heap_max_size_bytes()) {
  42   size_t init_old_byte_size = OldSize;
  43   size_t min_old_byte_size = MinOldSize;
  44   size_t max_old_byte_size = MaxOldSize;
  45   size_t init_young_byte_size = NewSize;
  46   size_t min_young_byte_size = MinNewSize;
  47   size_t max_young_byte_size = MaxNewSize;
  48   // create HeteroVirtualSpaces which is composed of non-overlapping virtual spaces.
  49   HeteroVirtualSpaces* hetero_virtual_spaces = new HeteroVirtualSpaces(old_young_rs, min_old_byte_size,
  50                                                                        min_young_byte_size, _total_size_limit);
  51 
  52   assert(min_old_byte_size <= init_old_byte_size &&
  53          init_old_byte_size <= max_old_byte_size, "Parameter check");
  54   assert(min_young_byte_size <= init_young_byte_size &&
  55          init_young_byte_size <= max_young_byte_size, "Parameter check");
  56 
  57   assert(UseAdaptiveGCBoundary, "Should be used only when UseAdaptiveGCBoundary is true");
  58 
  59   // Initialize the virtual spaces. Then pass a virtual space to each generation
  60   // for initialization of the generation.
  61 


  68                                 hetero_virtual_spaces->max_young_size());
  69 
  70   _old_gen = new ASPSOldGen(hetero_virtual_spaces->low(),
  71                             hetero_virtual_spaces->low()->committed_size() /* intial_size */,
  72                             min_old_byte_size,
  73                             hetero_virtual_spaces->max_old_size(), "old", 1);
  74 
  75   young_gen()->initialize_work();
  76   assert(young_gen()->reserved().byte_size() <= young_gen()->gen_size_limit(), "Consistency check");
  77   assert(old_young_rs.size() >= young_gen()->gen_size_limit(), "Consistency check");
  78 
  79   old_gen()->initialize_work("old", 1);
  80   assert(old_gen()->reserved().byte_size() <= old_gen()->gen_size_limit(), "Consistency check");
  81   assert(old_young_rs.size() >= old_gen()->gen_size_limit(), "Consistency check");
  82 
  83   _virtual_spaces = hetero_virtual_spaces;
  84 }
  85 
  86 size_t AdjoiningGenerationsForHeteroHeap::required_reserved_memory() {
  87   // This is the size that young gen can grow to, when AdaptiveGCBoundary is true.
  88   size_t max_yg_size = ParallelArguments::heap_max_size_bytes() - MinOldSize;
  89   // This is the size that old gen can grow to, when AdaptiveGCBoundary is true.
  90   size_t max_old_size = ParallelArguments::heap_max_size_bytes() - MinNewSize;
  91 
  92   return max_yg_size + max_old_size;
  93 }
  94 
  95 // We override this function since size of reservedspace here is more than heap size and
  96 // callers expect this function to return heap size.
  97 size_t AdjoiningGenerationsForHeteroHeap::reserved_byte_size() {
  98   return total_size_limit();
  99 }
 100 
 101 AdjoiningGenerationsForHeteroHeap::HeteroVirtualSpaces::HeteroVirtualSpaces(ReservedSpace rs, size_t min_old_byte_size, size_t min_yg_byte_size, size_t max_total_size) :
 102                                                                             AdjoiningVirtualSpaces(rs, min_old_byte_size, min_yg_byte_size, GenAlignment),
 103                                                                             _max_total_size(max_total_size),
 104                                                                             _min_old_byte_size(min_old_byte_size),
 105                                                                             _min_young_byte_size(min_yg_byte_size),
 106                                                                             _max_old_byte_size(_max_total_size - _min_young_byte_size),
 107                                                                             _max_young_byte_size(_max_total_size - _min_old_byte_size) {
 108 }
 109 
 110 void AdjoiningGenerationsForHeteroHeap::HeteroVirtualSpaces::initialize(size_t initial_old_reserved_size, size_t init_old_byte_size,




  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/parallel/adjoiningGenerationsForHeteroHeap.hpp"
  27 #include "gc/parallel/adjoiningVirtualSpaces.hpp"
  28 #include "gc/parallel/parallelArguments.hpp"
  29 #include "gc/parallel/parallelScavengeHeap.hpp"
  30 #include "gc/parallel/psFileBackedVirtualspace.hpp"
  31 #include "logging/log.hpp"
  32 #include "logging/logStream.hpp"
  33 #include "memory/resourceArea.hpp"
  34 #include "utilities/align.hpp"
  35 #include "utilities/ostream.hpp"
  36 
  37 // Create two virtual spaces (HeteroVirtualSpaces), low() on nv-dimm memory, high() on dram.
  38 // create ASPSOldGen and ASPSYoungGen the same way as in base class
  39 
  40 AdjoiningGenerationsForHeteroHeap::AdjoiningGenerationsForHeteroHeap(ReservedSpace old_young_rs) :
  41   _total_size_limit(ParallelArguments::heap_reserved_size_bytes()) {
  42   size_t init_old_byte_size = OldSize;
  43   size_t min_old_byte_size = MinOldSize;
  44   size_t max_old_byte_size = MaxOldSize;
  45   size_t init_young_byte_size = NewSize;
  46   size_t min_young_byte_size = MinNewSize;
  47   size_t max_young_byte_size = MaxNewSize;
  48   // create HeteroVirtualSpaces which is composed of non-overlapping virtual spaces.
  49   HeteroVirtualSpaces* hetero_virtual_spaces = new HeteroVirtualSpaces(old_young_rs, min_old_byte_size,
  50                                                                        min_young_byte_size, _total_size_limit);
  51 
  52   assert(min_old_byte_size <= init_old_byte_size &&
  53          init_old_byte_size <= max_old_byte_size, "Parameter check");
  54   assert(min_young_byte_size <= init_young_byte_size &&
  55          init_young_byte_size <= max_young_byte_size, "Parameter check");
  56 
  57   assert(UseAdaptiveGCBoundary, "Should be used only when UseAdaptiveGCBoundary is true");
  58 
  59   // Initialize the virtual spaces. Then pass a virtual space to each generation
  60   // for initialization of the generation.
  61 


  68                                 hetero_virtual_spaces->max_young_size());
  69 
  70   _old_gen = new ASPSOldGen(hetero_virtual_spaces->low(),
  71                             hetero_virtual_spaces->low()->committed_size() /* intial_size */,
  72                             min_old_byte_size,
  73                             hetero_virtual_spaces->max_old_size(), "old", 1);
  74 
  75   young_gen()->initialize_work();
  76   assert(young_gen()->reserved().byte_size() <= young_gen()->gen_size_limit(), "Consistency check");
  77   assert(old_young_rs.size() >= young_gen()->gen_size_limit(), "Consistency check");
  78 
  79   old_gen()->initialize_work("old", 1);
  80   assert(old_gen()->reserved().byte_size() <= old_gen()->gen_size_limit(), "Consistency check");
  81   assert(old_young_rs.size() >= old_gen()->gen_size_limit(), "Consistency check");
  82 
  83   _virtual_spaces = hetero_virtual_spaces;
  84 }
  85 
  86 size_t AdjoiningGenerationsForHeteroHeap::required_reserved_memory() {
  87   // This is the size that young gen can grow to, when AdaptiveGCBoundary is true.
  88   size_t max_yg_size = ParallelArguments::heap_reserved_size_bytes() - MinOldSize;
  89   // This is the size that old gen can grow to, when AdaptiveGCBoundary is true.
  90   size_t max_old_size = ParallelArguments::heap_reserved_size_bytes() - MinNewSize;
  91 
  92   return max_yg_size + max_old_size;
  93 }
  94 
  95 // We override this function since size of reservedspace here is more than heap size and
  96 // callers expect this function to return heap size.
  97 size_t AdjoiningGenerationsForHeteroHeap::reserved_byte_size() {
  98   return total_size_limit();
  99 }
 100 
 101 AdjoiningGenerationsForHeteroHeap::HeteroVirtualSpaces::HeteroVirtualSpaces(ReservedSpace rs, size_t min_old_byte_size, size_t min_yg_byte_size, size_t max_total_size) :
 102                                                                             AdjoiningVirtualSpaces(rs, min_old_byte_size, min_yg_byte_size, GenAlignment),
 103                                                                             _max_total_size(max_total_size),
 104                                                                             _min_old_byte_size(min_old_byte_size),
 105                                                                             _min_young_byte_size(min_yg_byte_size),
 106                                                                             _max_old_byte_size(_max_total_size - _min_young_byte_size),
 107                                                                             _max_young_byte_size(_max_total_size - _min_old_byte_size) {
 108 }
 109 
 110 void AdjoiningGenerationsForHeteroHeap::HeteroVirtualSpaces::initialize(size_t initial_old_reserved_size, size_t init_old_byte_size,


< prev index next >