hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp
changeset 21560 b3ae3ba25ebb
parent 7397 5b173b4ca846
child 21561 c619b1cb4554
equal deleted inserted replaced
21559:c5421f5c6ffd 21560:b3ae3ba25ebb
    68   initialize_virtual_space(rs, alignment);
    68   initialize_virtual_space(rs, alignment);
    69   initialize_work();
    69   initialize_work();
    70 }
    70 }
    71 
    71 
    72 size_t ASPSYoungGen::available_for_expansion() {
    72 size_t ASPSYoungGen::available_for_expansion() {
    73 
       
    74   size_t current_committed_size = virtual_space()->committed_size();
    73   size_t current_committed_size = virtual_space()->committed_size();
    75   assert((gen_size_limit() >= current_committed_size),
    74   assert((gen_size_limit() >= current_committed_size),
    76     "generation size limit is wrong");
    75     "generation size limit is wrong");
    77   ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
    76   ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
    78   size_t result =  gen_size_limit() - current_committed_size;
    77   size_t result =  gen_size_limit() - current_committed_size;
    83 // Return the number of bytes the young gen is willing give up.
    82 // Return the number of bytes the young gen is willing give up.
    84 //
    83 //
    85 // Future implementations could check the survivors and if to_space is in the
    84 // Future implementations could check the survivors and if to_space is in the
    86 // right place (below from_space), take a chunk from to_space.
    85 // right place (below from_space), take a chunk from to_space.
    87 size_t ASPSYoungGen::available_for_contraction() {
    86 size_t ASPSYoungGen::available_for_contraction() {
    88 
       
    89   size_t uncommitted_bytes = virtual_space()->uncommitted_size();
    87   size_t uncommitted_bytes = virtual_space()->uncommitted_size();
    90   if (uncommitted_bytes != 0) {
    88   if (uncommitted_bytes != 0) {
    91     return uncommitted_bytes;
    89     return uncommitted_bytes;
    92   }
    90   }
    93 
    91 
   119       gclog_or_tty->print_cr("  max_contraction %d K", max_contraction/K);
   117       gclog_or_tty->print_cr("  max_contraction %d K", max_contraction/K);
   120       gclog_or_tty->print_cr("  eden_avail %d K", eden_avail/K);
   118       gclog_or_tty->print_cr("  eden_avail %d K", eden_avail/K);
   121       gclog_or_tty->print_cr("  gen_avail %d K", gen_avail/K);
   119       gclog_or_tty->print_cr("  gen_avail %d K", gen_avail/K);
   122     }
   120     }
   123     return result_aligned;
   121     return result_aligned;
   124 
       
   125   }
   122   }
   126 
   123 
   127   return 0;
   124   return 0;
   128 }
   125 }
   129 
   126