# HG changeset patch # User rkennke # Date 1508412376 -7200 # Thu Oct 19 13:26:16 2017 +0200 # Node ID ce3795f90b4ca7817673818884e676b3fadf4ef5 # Parent 3e7702cd3f19732fc3d210e98d6ffc537faaee8f 8189373: jmap -heap exited with error code Summary: Add CMSHeap related bits to SA code Reviewed-by: dholmes, jgeorge diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -48,6 +48,7 @@ #include "gc/parallel/mutableSpace.hpp" #include "gc/serial/defNewGeneration.hpp" #include "gc/serial/tenuredGeneration.hpp" +#include "gc/cms/cmsHeap.hpp" #include "gc/shared/cardTableRS.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/genCollectedHeap.hpp" @@ -1463,6 +1464,7 @@ \ declare_toplevel_type(CollectedHeap) \ declare_type(GenCollectedHeap, CollectedHeap) \ + declare_type(CMSHeap, GenCollectedHeap) \ declare_toplevel_type(Generation) \ declare_type(DefNewGeneration, Generation) \ declare_type(CardGeneration, Generation) \ diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CMSHeap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CMSHeap.java new file mode 100644 --- /dev/null +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CMSHeap.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates. + * 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. + * + */ + +package sun.jvm.hotspot.gc.cms; + +import sun.jvm.hotspot.debugger.Address; +import sun.jvm.hotspot.gc.shared.GenCollectedHeap; +import sun.jvm.hotspot.gc.shared.CollectedHeapName; + +public class CMSHeap extends GenCollectedHeap { + + public CMSHeap(Address addr) { + super(addr); + } + + public CollectedHeapName kind() { + return CollectedHeapName.CMS_HEAP; + } +} diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, 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 @@ -32,6 +32,7 @@ private CollectedHeapName(String name) { this.name = name; } public static final CollectedHeapName GEN_COLLECTED_HEAP = new CollectedHeapName("GenCollectedHeap"); + public static final CollectedHeapName CMS_HEAP = new CollectedHeapName("CMSHeap"); public static final CollectedHeapName G1_COLLECTED_HEAP = new CollectedHeapName("G1CollectedHeap"); public static final CollectedHeapName PARALLEL_SCAVENGE_HEAP = new CollectedHeapName("ParallelScavengeHeap"); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/Universe.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/Universe.java --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/Universe.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/Universe.java @@ -27,6 +27,7 @@ import java.io.*; import java.util.*; import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.gc.cms.CMSHeap; import sun.jvm.hotspot.gc.shared.*; import sun.jvm.hotspot.gc.g1.G1CollectedHeap; import sun.jvm.hotspot.gc.parallel.*; @@ -77,6 +78,7 @@ heapConstructor = new VirtualConstructor(db); heapConstructor.addMapping("GenCollectedHeap", GenCollectedHeap.class); + heapConstructor.addMapping("CMSHeap", CMSHeap.class); heapConstructor.addMapping("ParallelScavengeHeap", ParallelScavengeHeap.class); heapConstructor.addMapping("G1CollectedHeap", G1CollectedHeap.class);