mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8038423: G1: Decommit memory within heap
Allow G1 to decommit memory of arbitrary regions within the heap and their associated auxiliary data structures card table, BOT, hot card cache, and mark bitmaps. Reviewed-by: mgerdin, brutisso, jwilhelm
This commit is contained in:
parent
2617d54723
commit
100e51a339
32 changed files with 1322 additions and 579 deletions
|
@ -373,17 +373,17 @@ void FromCardCache::initialize(uint n_par_rs, uint max_num_regions) {
|
|||
_max_regions,
|
||||
&_static_mem_size);
|
||||
|
||||
for (uint i = 0; i < n_par_rs; i++) {
|
||||
for (uint j = 0; j < _max_regions; j++) {
|
||||
set(i, j, InvalidCard);
|
||||
}
|
||||
}
|
||||
invalidate(0, _max_regions);
|
||||
}
|
||||
|
||||
void FromCardCache::shrink(uint new_num_regions) {
|
||||
void FromCardCache::invalidate(uint start_idx, size_t new_num_regions) {
|
||||
guarantee((size_t)start_idx + new_num_regions <= max_uintx,
|
||||
err_msg("Trying to invalidate beyond maximum region, from %u size "SIZE_FORMAT,
|
||||
start_idx, new_num_regions));
|
||||
for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) {
|
||||
assert(new_num_regions <= _max_regions, "Must be within max.");
|
||||
for (uint j = new_num_regions; j < _max_regions; j++) {
|
||||
uint end_idx = (start_idx + (uint)new_num_regions);
|
||||
assert(end_idx <= _max_regions, "Must be within max.");
|
||||
for (uint j = start_idx; j < end_idx; j++) {
|
||||
set(i, j, InvalidCard);
|
||||
}
|
||||
}
|
||||
|
@ -407,12 +407,12 @@ void FromCardCache::clear(uint region_idx) {
|
|||
}
|
||||
}
|
||||
|
||||
void OtherRegionsTable::init_from_card_cache(uint max_regions) {
|
||||
void OtherRegionsTable::initialize(uint max_regions) {
|
||||
FromCardCache::initialize(HeapRegionRemSet::num_par_rem_sets(), max_regions);
|
||||
}
|
||||
|
||||
void OtherRegionsTable::shrink_from_card_cache(uint new_num_regions) {
|
||||
FromCardCache::shrink(new_num_regions);
|
||||
void OtherRegionsTable::invalidate(uint start_idx, size_t num_regions) {
|
||||
FromCardCache::invalidate(start_idx, num_regions);
|
||||
}
|
||||
|
||||
void OtherRegionsTable::print_from_card_cache() {
|
||||
|
@ -841,7 +841,7 @@ HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetSharedArray* bosa,
|
|||
HeapRegion* hr)
|
||||
: _bosa(bosa),
|
||||
_m(Mutex::leaf, FormatBuffer<128>("HeapRegionRemSet lock #%u", hr->hrs_index()), true),
|
||||
_code_roots(), _other_regions(hr, &_m) {
|
||||
_code_roots(), _other_regions(hr, &_m), _iter_state(Unclaimed), _iter_claimed(0) {
|
||||
reset_for_par_iteration();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue