RFR: 8263915: runtime/cds/appcds/MismatchedPathTriggerMemoryRelease.java fails when UseCompressedClassPointers is off
Ioi Lam
iklam at openjdk.java.net
Mon Mar 22 21:38:40 UTC 2021
On Mon, 22 Mar 2021 20:50:25 GMT, Yumin Qi <minqi at openjdk.org> wrote:
> > Hi Jie,
> > I think it would be better to couple this not to bitness but directly to UseCompressedClassPointers. The test should also work if we run it with a 64bit VM with compressed class pointers off.
> > To keep matters simple, I think one could even match either pattern always instead of making it dependent on CompressedClassPointers, but I leave this up to the CDS guys.
> > Thanks, Thomas
>
> Hi, Thomas, Jie
> On 32bit platform, UseCompressedOops/UseCompressedClassPointers do not exist. So checking for that flag is a little different I think. @DamonFool , could you try to use WhiteBox.getBooleanVMFlag("UseCompressedClassPointers") to check this flag? If it does not exists, it should return null, or it is true/false. This way, you can have two patterns to check again the result.
>
> Thanks
> Yumin
I think the test just needs to find out that the following function is called to release memory:
void MetaspaceShared::release_reserved_spaces(ReservedSpace& total_space_rs,
ReservedSpace& archive_space_rs,
ReservedSpace& class_space_rs) {
if (total_space_rs.is_reserved()) {
log_debug(cds)("Released shared space (archive + class) " INTPTR_FORMAT, p2i(total_space_rs.base()));
total_space_rs.release();
} else {
if (archive_space_rs.is_reserved()) {
log_debug(cds)("Released shared space (archive) " INTPTR_FORMAT, p2i(archive_space_rs.base()));
archive_space_rs.release();
}
if (class_space_rs.is_reserved()) {
log_debug(cds)("Released shared space (classes) " INTPTR_FORMAT, p2i(class_space_rs.base()));
class_space_rs.release();
}
}
}
Note that the first `log_debug` is not always called. For example: the test fails even on 64-bit platforms if you run with:
jtreg -vmoptions:-XX:-UseCompressedClassPointers \
MismatchedPathTriggerMemoryRelease.java
Also, if `(use_windows_memory_mapping() && use_archive_base_addr)` is true, `total_space_rs` is not reserved.
I think we can relax the regexp to something like this so that the test is more resilient:
"Released shared space .* 0(x|X)[0-9a-fA-F]+$";
-------------
PR: https://git.openjdk.java.net/jdk/pull/3110
More information about the hotspot-runtime-dev
mailing list