PageBoxLib
Class MemUsage

java.lang.Object
  extended byPageBoxLib.MemUsage
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ResourceUsage

public class MemUsage
extends java.lang.Object
implements java.io.Serializable

Interface to objects returning resource memory data.

alexis.grandemange@pagebox.net

Copyright (c) 2002-2004 Alexis Grandemange

This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public License
 as published by the Free Software Foundation; version 2.1 of the
 License.
 This library 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 Lesser General Public License for more details.
 A copy of the GNU Lesser General Public License lesser.txt should be
 included in the distribution.

Version:
0, 0, 13
Author:
Alexis Grandemange
See Also:
Serialized Form

Field Summary
 long free
          Free memory in the Java Virtual Machine
 long max
          Maximum amount of memory that the Java virtual machine will attempt to use
 java.lang.String msg
          Error message or null when valid data.
 long netTime
          Time in millisecond to send a frame and get the answer
 long total
          Total amount of memory in the Java virtual machine
 
Constructor Summary
MemUsage()
           
 
Method Summary
(package private)  void init(long netTime)
          Initialization method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

free

public long free
Free memory in the Java Virtual Machine


total

public long total
Total amount of memory in the Java virtual machine


max

public long max
Maximum amount of memory that the Java virtual machine will attempt to use


netTime

public long netTime
Time in millisecond to send a frame and get the answer


msg

public java.lang.String msg
Error message or null when valid data. Values of interest:
  1. first measure

Constructor Detail

MemUsage

public MemUsage()
Method Detail

init

void init(long netTime)
Initialization method. Can be overriden with an extension to ResourceUsage in a probe. .p>Calls Runtime to get JVM data.

On some JVM maxMemory takes a NoSuchMethodError. Hence the try.