2796 return NULL;
2797 }
2798 #endif
2799
2800 HeapWord*
2801 ConcurrentMarkSweepGeneration::expand_and_allocate(size_t word_size,
2802 bool tlab,
2803 bool parallel) {
2804 CMSSynchronousYieldRequest yr;
2805 assert(!tlab, "Can't deal with TLAB allocation");
2806 MutexLockerEx x(freelistLock(), Mutex::_no_safepoint_check_flag);
2807 expand(word_size*HeapWordSize, MinHeapDeltaBytes,
2808 CMSExpansionCause::_satisfy_allocation);
2809 if (GCExpandToAllocateDelayMillis > 0) {
2810 os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
2811 }
2812 return have_lock_and_allocate(word_size, tlab);
2813 }
2814
2815 // YSR: All of this generation expansion/shrinking stuff is an exact copy of
2816 // OneContigSpaceCardGeneration, which makes me wonder if we should move this
2817 // to CardGeneration and share it...
2818 bool ConcurrentMarkSweepGeneration::expand(size_t bytes, size_t expand_bytes) {
2819 return CardGeneration::expand(bytes, expand_bytes);
2820 }
2821
2822 void ConcurrentMarkSweepGeneration::expand(size_t bytes, size_t expand_bytes,
2823 CMSExpansionCause::Cause cause)
2824 {
2825
2826 bool success = expand(bytes, expand_bytes);
2827
2828 // remember why we expanded; this information is used
2829 // by shouldConcurrentCollect() when making decisions on whether to start
2830 // a new CMS cycle.
2831 if (success) {
2832 set_expansion_cause(cause);
2833 if (PrintGCDetails && Verbose) {
2834 gclog_or_tty->print_cr("Expanded CMS gen for %s",
2835 CMSExpansionCause::to_string(cause));
2836 }
|
2796 return NULL;
2797 }
2798 #endif
2799
2800 HeapWord*
2801 ConcurrentMarkSweepGeneration::expand_and_allocate(size_t word_size,
2802 bool tlab,
2803 bool parallel) {
2804 CMSSynchronousYieldRequest yr;
2805 assert(!tlab, "Can't deal with TLAB allocation");
2806 MutexLockerEx x(freelistLock(), Mutex::_no_safepoint_check_flag);
2807 expand(word_size*HeapWordSize, MinHeapDeltaBytes,
2808 CMSExpansionCause::_satisfy_allocation);
2809 if (GCExpandToAllocateDelayMillis > 0) {
2810 os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
2811 }
2812 return have_lock_and_allocate(word_size, tlab);
2813 }
2814
2815 // YSR: All of this generation expansion/shrinking stuff is an exact copy of
2816 // TenuredGeneration, which makes me wonder if we should move this
2817 // to CardGeneration and share it...
2818 bool ConcurrentMarkSweepGeneration::expand(size_t bytes, size_t expand_bytes) {
2819 return CardGeneration::expand(bytes, expand_bytes);
2820 }
2821
2822 void ConcurrentMarkSweepGeneration::expand(size_t bytes, size_t expand_bytes,
2823 CMSExpansionCause::Cause cause)
2824 {
2825
2826 bool success = expand(bytes, expand_bytes);
2827
2828 // remember why we expanded; this information is used
2829 // by shouldConcurrentCollect() when making decisions on whether to start
2830 // a new CMS cycle.
2831 if (success) {
2832 set_expansion_cause(cause);
2833 if (PrintGCDetails && Verbose) {
2834 gclog_or_tty->print_cr("Expanded CMS gen for %s",
2835 CMSExpansionCause::to_string(cause));
2836 }
|