8055061: assert at share/vm/services/virtualMemoryTracker.cpp:332 Error: ShouldNotReachHere() when running NMT tests

Handled CDS mapping region and added test for the scenario

Reviewed-by: coleenp, ctornqvi
This commit is contained in:
Zhengyu Gu 2014-08-19 09:05:55 -04:00
parent 2d98294837
commit 7bce315059
2 changed files with 66 additions and 3 deletions

View file

@ -337,10 +337,18 @@ bool VirtualMemoryTracker::add_reserved_region(address base_addr, size_t size,
*reserved_rgn = rgn;
return true;
} else {
ShouldNotReachHere();
return false;
}
// CDS mapping region.
// CDS reserves the whole region for mapping CDS archive, then maps each section into the region.
// NMT reports CDS as a whole.
if (reserved_rgn->flag() == mtClassShared) {
assert(reserved_rgn->contain_region(base_addr, size), "Reserved CDS region should contain this mapping region");
return true;
}
ShouldNotReachHere();
return false;
}
}
}