< prev index next > src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp
Print this page
// Not under a lock here, so read each of these once to make sure
// byte size in proper unit and proper unit for byte size are consistent.
const size_t v_used = used();
const size_t v_used_regions = used_regions_size();
! const size_t v_soft_max_capacity = soft_max_capacity();
const size_t v_max_capacity = max_capacity();
const size_t v_available = available();
const size_t v_humongous_waste = get_humongous_waste();
const LogGcInfo target;
// Not under a lock here, so read each of these once to make sure
// byte size in proper unit and proper unit for byte size are consistent.
const size_t v_used = used();
const size_t v_used_regions = used_regions_size();
! const size_t v_soft_max_capacity = ShenandoahHeap::heap()->soft_max_capacity();
const size_t v_max_capacity = max_capacity();
const size_t v_available = available();
const size_t v_humongous_waste = get_humongous_waste();
const LogGcInfo target;
set_concurrent_mark_in_progress(false);
}
ShenandoahGeneration::ShenandoahGeneration(ShenandoahGenerationType type,
uint max_workers,
! size_t max_capacity,
- size_t soft_max_capacity) :
_type(type),
_task_queues(new ShenandoahObjToScanQueueSet(max_workers)),
_ref_processor(new ShenandoahReferenceProcessor(MAX2(max_workers, 1U))),
_affiliated_region_count(0), _humongous_waste(0), _evacuation_reserve(0),
_used(0), _bytes_allocated_since_gc_start(0),
! _max_capacity(max_capacity), _soft_max_capacity(soft_max_capacity),
_heuristics(nullptr)
{
_is_marking_complete.set();
assert(max_workers > 0, "At least one queue");
for (uint i = 0; i < max_workers; ++i) {
set_concurrent_mark_in_progress(false);
}
ShenandoahGeneration::ShenandoahGeneration(ShenandoahGenerationType type,
uint max_workers,
! size_t max_capacity) :
_type(type),
_task_queues(new ShenandoahObjToScanQueueSet(max_workers)),
_ref_processor(new ShenandoahReferenceProcessor(MAX2(max_workers, 1U))),
_affiliated_region_count(0), _humongous_waste(0), _evacuation_reserve(0),
_used(0), _bytes_allocated_since_gc_start(0),
! _max_capacity(max_capacity),
_heuristics(nullptr)
{
_is_marking_complete.set();
assert(max_workers > 0, "At least one queue");
for (uint i = 0; i < max_workers; ++i) {
size_t ShenandoahGeneration::available_with_reserve() const {
return available(max_capacity());
}
size_t ShenandoahGeneration::soft_available() const {
! return available(soft_max_capacity());
}
size_t ShenandoahGeneration::available(size_t capacity) const {
size_t in_use = used() + get_humongous_waste();
return in_use > capacity ? 0 : capacity - in_use;
size_t ShenandoahGeneration::available_with_reserve() const {
return available(max_capacity());
}
size_t ShenandoahGeneration::soft_available() const {
! return available(ShenandoahHeap::heap()->soft_max_capacity());
}
size_t ShenandoahGeneration::available(size_t capacity) const {
size_t in_use = used() + get_humongous_waste();
return in_use > capacity ? 0 : capacity - in_use;
< prev index next >