< prev index next >
src/share/vm/services/shenandoahMemoryPool.cpp
Print this page
rev 10758 : [backport] Initial committed regions count can be more than max
rev 10767 : [backport] ShenandoahMemoryPool should support usage threshold
*** 27,41 ****
ShenandoahMemoryPool::ShenandoahMemoryPool(ShenandoahHeap* heap) :
CollectedMemoryPool("Shenandoah",
MemoryPool::Heap,
heap->capacity(),
heap->max_capacity(),
! false /* support_usage_threshold */),
_heap(heap) {}
MemoryUsage ShenandoahMemoryPool::get_memory_usage() {
! size_t maxSize = max_size();
size_t used = used_in_bytes();
size_t committed = _heap->committed();
! return MemoryUsage(initial_size(), used, committed, maxSize);
}
--- 27,47 ----
ShenandoahMemoryPool::ShenandoahMemoryPool(ShenandoahHeap* heap) :
CollectedMemoryPool("Shenandoah",
MemoryPool::Heap,
heap->capacity(),
heap->max_capacity(),
! true /* support_usage_threshold */),
_heap(heap) {}
MemoryUsage ShenandoahMemoryPool::get_memory_usage() {
! size_t initial = initial_size();
! size_t max = max_size();
size_t used = used_in_bytes();
size_t committed = _heap->committed();
! assert(initial <= max, err_msg("initial: " SIZE_FORMAT ", max: " SIZE_FORMAT, initial, max));
! assert(used <= max, err_msg("used: " SIZE_FORMAT ", max: " SIZE_FORMAT, used, max));
! assert(committed <= max, err_msg("committed: " SIZE_FORMAT ", max: " SIZE_FORMAT, committed, max));
! assert(used <= committed, err_msg("used: " SIZE_FORMAT ", committed: " SIZE_FORMAT, used, committed));
!
! return MemoryUsage(initial, used, committed, max);
}
< prev index next >