8061715: gc/g1/TestShrinkAuxiliaryData15.java fails with java.lang.RuntimeException: heap decommit failed - after > before

Added WhiteBox methods to count regions and exact aux data sizes

Reviewed-by: tschatzl, jwilhelm, mgerdin
This commit is contained in:
Andrey Zakharov 2015-03-16 17:51:28 +03:00
parent 7e86840f64
commit 9272128a46
13 changed files with 192 additions and 75 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -145,6 +145,24 @@ void HeapRegionManager::make_regions_available(uint start, uint num_regions) {
}
}
MemoryUsage HeapRegionManager::get_auxiliary_data_memory_usage() const {
size_t used_sz =
_prev_bitmap_mapper->committed_size() +
_next_bitmap_mapper->committed_size() +
_bot_mapper->committed_size() +
_cardtable_mapper->committed_size() +
_card_counts_mapper->committed_size();
size_t committed_sz =
_prev_bitmap_mapper->reserved_size() +
_next_bitmap_mapper->reserved_size() +
_bot_mapper->reserved_size() +
_cardtable_mapper->reserved_size() +
_card_counts_mapper->reserved_size();
return MemoryUsage(0, used_sz, committed_sz, committed_sz);
}
uint HeapRegionManager::expand_by(uint num_regions) {
return expand_at(0, num_regions);
}