8210265: Crash in HSpaceCounters::update_used()

Guard call to update HSpaceCounters with flag

Reviewed-by: shade, sjohanss, kbarrett
This commit is contained in:
Thomas Schatzl 2018-09-04 12:17:23 +02:00
parent a5f7028279
commit a7d4df53fa
2 changed files with 39 additions and 1 deletions

View File

@ -170,7 +170,9 @@ G1MonitoringSupport::G1MonitoringSupport(G1CollectedHeap* g1h) :
// Given that this survivor space is not used, we update it here
// once to reflect that its used space is 0 so that we don't have to
// worry about updating it again later.
_from_space_counters->update_used(0);
if (UsePerfData) {
_from_space_counters->update_used(0);
}
// name "generation.0.space.2"
// See _old_space_counters for additional counters

View File

@ -0,0 +1,36 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test TestNoPerfCounter
* @bug 8210265
* @requires vm.gc=="null"
* @library /test/lib /
* @summary Tests that disabling perf counters does not crash the VM
* @run main/othervm -XX:-UsePerfData TestNoPerfCounter
*/
public class TestNoPerfCounter {
public static void main(String[] args) throws Exception {
// Nothing to do
}
}