8038212: Method::is_valid_method() check has performance regression impact for stackwalking

Only prune metaspace virtual spaces at safepoint so walking them is safe outside a safepoint.

Reviewed-by: mgerdin, mgronlun, hseigel, stefank
This commit is contained in:
Coleen Phillimore 2014-05-15 18:23:26 -04:00
parent cc3c656cf1
commit c336175c94
13 changed files with 84 additions and 72 deletions

View file

@ -6362,7 +6362,9 @@ void CMSCollector::sweep(bool asynch) {
verify_overflow_empty();
if (should_unload_classes()) {
ClassLoaderDataGraph::purge();
// Delay purge to the beginning of the next safepoint. Metaspace::contains
// requires that the virtual spaces are stable and not deleted.
ClassLoaderDataGraph::set_should_purge(true);
}
_intra_sweep_timer.stop();