KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > container > monitor > jvm > v15 > MemoryInfo


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.container.monitor.jvm.v15;
6
7
8 import java.lang.management.ManagementFactory JavaDoc;
9 import java.lang.management.MemoryMXBean JavaDoc;
10 import java.lang.management.MemoryUsage JavaDoc;
11 /**
12  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
13  * @since Nov 8, 2004
14  * @version $Id$
15  */

16 public class MemoryInfo {
17   private MemoryMXBean JavaDoc mxbean_ ;
18   
19   public MemoryInfo() {
20     mxbean_ = ManagementFactory.getMemoryMXBean();
21   }
22   
23   public MemoryUsage JavaDoc getHeapMemoryUsage() {
24     return mxbean_.getHeapMemoryUsage() ;
25   }
26
27   public MemoryUsage JavaDoc getNonHeapMemoryUsage() {
28     return mxbean_.getNonHeapMemoryUsage() ;
29   }
30   
31   public int getObjectPendingFinalizationCount() {
32     return mxbean_.getObjectPendingFinalizationCount() ;
33   }
34   
35   public boolean isVerbose() { return mxbean_.isVerbose() ; }
36   
37 }
Popular Tags