419 return OneContigSpaceCardGeneration::max_capacity() |
419 return OneContigSpaceCardGeneration::max_capacity() |
420 - _shared_space_size; |
420 - _shared_space_size; |
421 } |
421 } |
422 |
422 |
423 |
423 |
424 |
|
425 bool CompactingPermGenGen::grow_by(size_t bytes) { |
|
426 // Don't allow _virtual_size to expand into shared spaces. |
|
427 size_t max_bytes = _virtual_space.uncommitted_size() - _shared_space_size; |
|
428 if (bytes > _shared_space_size) { |
|
429 bytes = _shared_space_size; |
|
430 } |
|
431 return OneContigSpaceCardGeneration::grow_by(bytes); |
|
432 } |
|
433 |
|
434 |
|
435 bool CompactingPermGenGen::grow_to_reserved() { |
|
436 // Don't allow _virtual_size to expand into shared spaces. |
|
437 bool success = false; |
|
438 if (_virtual_space.uncommitted_size() > _shared_space_size) { |
|
439 size_t remaining_bytes = |
|
440 _virtual_space.uncommitted_size() - _shared_space_size; |
|
441 success = OneContigSpaceCardGeneration::grow_by(remaining_bytes); |
|
442 DEBUG_ONLY(if (!success) warning("grow to reserved failed");) |
|
443 } |
|
444 return success; |
|
445 } |
|
446 |
|
447 |
|
448 // No young generation references, clear this generation's main space's |
424 // No young generation references, clear this generation's main space's |
449 // card table entries. Do NOT clear the card table entries for the |
425 // card table entries. Do NOT clear the card table entries for the |
450 // read-only space (always clear) or the read-write space (valuable |
426 // read-only space (always clear) or the read-write space (valuable |
451 // information). |
427 // information). |
452 |
428 |