The destructor for KVHashtable should deallocate entries but it doesn't, so if you don't write the deallocation code yourself, entries will leak.
There are two KVHashtables in the code for CDS Dumping, which make it hard to notice the leak.
Something like:
~KVHashtable() {
KVHashtableEntry* probe = NULL;
for (int index = 0; index < table_size(); index++) {
for (KVHashtableEntry** p = bucket_addr(index); *p != NULL; ) {
probe = *p;
*p = probe->next();
free_entry(probe);
}
}
assert(BasicHashtable<F>::number_of_entries() == 0, "should have removed all entries");
}
There are two KVHashtables in the code for CDS Dumping, which make it hard to notice the leak.
Something like:
~KVHashtable() {
KVHashtableEntry* probe = NULL;
for (int index = 0; index < table_size(); index++) {
for (KVHashtableEntry** p = bucket_addr(index); *p != NULL; ) {
probe = *p;
*p = probe->next();
free_entry(probe);
}
}
assert(BasicHashtable<F>::number_of_entries() == 0, "should have removed all entries");
}
- relates to
-
JDK-8267935 Replace BasicHashtable and Hashtable
-
- Resolved
-
-
JDK-8268078 ClassListParser::_interfaces should be freed
-
- Resolved
-