8224847: gc/stress/TestReclaimStringsLeaksMemory.java fails with reserved greater than expected

Rehash threshold was too low for StringTable, and rehashed size table was too large.

Reviewed-by: rehn, gziemski
This commit is contained in:
Coleen Phillimore 2019-06-11 07:31:47 -04:00
parent 02f1d4430c
commit d571d105ae
4 changed files with 22 additions and 11 deletions

View file

@ -267,7 +267,7 @@ void SymbolTable::symbols_do(SymbolClosure *cl) {
// all symbols from the dynamic table
SymbolsDo sd(cl);
if (!_local_table->try_scan(Thread::current(), sd)) {
log_info(stringtable)("symbols_do unavailable at this moment");
log_info(symboltable)("symbols_do unavailable at this moment");
}
}
@ -557,7 +557,7 @@ void SymbolTable::verify() {
Thread* thr = Thread::current();
VerifySymbols vs;
if (!_local_table->try_scan(thr, vs)) {
log_info(stringtable)("verify unavailable at this moment");
log_info(symboltable)("verify unavailable at this moment");
}
}
@ -763,8 +763,9 @@ bool SymbolTable::do_rehash() {
return false;
}
// We use max size
SymbolTableHash* new_table = new SymbolTableHash(END_SIZE, END_SIZE, REHASH_LEN);
// We use current size
size_t new_size = _local_table->get_size_log2(Thread::current());
SymbolTableHash* new_table = new SymbolTableHash(new_size, END_SIZE, REHASH_LEN);
// Use alt hash from now on
_alt_hash = true;
if (!_local_table->try_move_nodes_to(Thread::current(), new_table)) {