Path: blob/master/src/jdk.jconsole/share/classes/sun/tools/jconsole/MemoryPoolStat.java
40948 views
/*1* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.tools.jconsole;2627import java.lang.management.MemoryUsage;2829public class MemoryPoolStat {30private String poolName;31private long usageThreshold;32private MemoryUsage usage;33private long lastGcId;34private long lastGcStartTime;35private long lastGcEndTime;36private long collectThreshold;37private MemoryUsage beforeGcUsage;38private MemoryUsage afterGcUsage;3940MemoryPoolStat(String name,41long usageThreshold,42MemoryUsage usage,43long lastGcId,44long lastGcStartTime,45long lastGcEndTime,46long collectThreshold,47MemoryUsage beforeGcUsage,48MemoryUsage afterGcUsage) {49this.poolName = name;50this.usageThreshold = usageThreshold;51this.usage = usage;52this.lastGcId = lastGcId;53this.lastGcStartTime = lastGcStartTime;54this.lastGcEndTime = lastGcEndTime;55this.collectThreshold = collectThreshold;56this.beforeGcUsage = beforeGcUsage;57this.afterGcUsage = afterGcUsage;58}5960/**61* Returns the memory pool name.62*/63public String getPoolName() {64return poolName;65}6667/**68* Returns the current memory usage.69*/70public MemoryUsage getUsage() {71return usage;72}7374/**75* Returns the current usage threshold.76* -1 if not supported.77*/78public long getUsageThreshold() {79return usageThreshold;80}8182/**83* Returns the current collection usage threshold.84* -1 if not supported.85*/86public long getCollectionUsageThreshold() {87return collectThreshold;88}8990/**91* Returns the Id of GC.92*/93public long getLastGcId() {94return lastGcId;95}969798/**99* Returns the start time of the most recent GC on100* the memory pool for this statistics in milliseconds.101*102* Return 0 if no GC occurs.103*/104public long getLastGcStartTime() {105return lastGcStartTime;106}107108/**109* Returns the end time of the most recent GC on110* the memory pool for this statistics in milliseconds.111*112* Return 0 if no GC occurs.113*/114public long getLastGcEndTime() {115return lastGcEndTime;116}117118/**119* Returns the memory usage before the most recent GC started.120* null if no GC occurs.121*/122public MemoryUsage getBeforeGcUsage() {123return beforeGcUsage;124}125126/**127* Returns the memory usage after the most recent GC finished.128* null if no GC occurs.129*/130public MemoryUsage getAfterGcUsage() {131return afterGcUsage;132}133}134135136