src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp

changeset 706
818a18cd69a8
parent 631
d1605aabd0a1
child 718
9199f248b0ee
     1.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Mon Jul 28 15:30:23 2008 -0700
     1.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Wed Jul 30 11:54:00 2008 -0700
     1.3 @@ -3195,31 +3195,16 @@
     1.4  // YSR: All of this generation expansion/shrinking stuff is an exact copy of
     1.5  // OneContigSpaceCardGeneration, which makes me wonder if we should move this
     1.6  // to CardGeneration and share it...
     1.7 +bool ConcurrentMarkSweepGeneration::expand(size_t bytes, size_t expand_bytes) {
     1.8 +  return CardGeneration::expand(bytes, expand_bytes);
     1.9 +}
    1.10 +
    1.11  void ConcurrentMarkSweepGeneration::expand(size_t bytes, size_t expand_bytes,
    1.12    CMSExpansionCause::Cause cause)
    1.13  {
    1.14 -  assert_locked_or_safepoint(Heap_lock);
    1.15 -
    1.16 -  size_t aligned_bytes  = ReservedSpace::page_align_size_up(bytes);
    1.17 -  size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(expand_bytes);
    1.18 -  bool success = false;
    1.19 -  if (aligned_expand_bytes > aligned_bytes) {
    1.20 -    success = grow_by(aligned_expand_bytes);
    1.21 -  }
    1.22 -  if (!success) {
    1.23 -    success = grow_by(aligned_bytes);
    1.24 -  }
    1.25 -  if (!success) {
    1.26 -    size_t remaining_bytes = _virtual_space.uncommitted_size();
    1.27 -    if (remaining_bytes > 0) {
    1.28 -      success = grow_by(remaining_bytes);
    1.29 -    }
    1.30 -  }
    1.31 -  if (GC_locker::is_active()) {
    1.32 -    if (PrintGC && Verbose) {
    1.33 -      gclog_or_tty->print_cr("Garbage collection disabled, expanded heap instead");
    1.34 -    }
    1.35 -  }
    1.36 +
    1.37 +  bool success = expand(bytes, expand_bytes);
    1.38 +
    1.39    // remember why we expanded; this information is used
    1.40    // by shouldConcurrentCollect() when making decisions on whether to start
    1.41    // a new CMS cycle.

mercurial