站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

MemoryMeasurement (NB JUnit) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.nbjunit/1 1.41

org.netbeans.junit
Class MemoryMeasurement

java.lang.Object
  extended by org.netbeans.junit.MemoryMeasurement

public class MemoryMeasurement
extends Object

Class with static methods for measuring memory footprint of a process. Since this class required platform dependent code, there have to be a dll library called 'lib.memory-measurement.win32.dll' present in a home directory of NbJUnit (set by nbjunit.home property in either junit.properties file or present as a system property). Please note, methods available in this class return a system specific values for each supported platforms. The meanings of values are: On Solaris: resident memory size On Linux: VmSize (virtual memory size) On Windows: pagefile usage


Field Summary
static String IDE_PID_SYSTEM_PROPERTY
          Name of the system property, which contains PID of running IDE.
 
Method Summary
static long getIdeMemoryFootPrint()
          Gets memory footprint of NetBeans IDE.
static long getProcessMemoryFootPrint(long pid)
          Gets memory footprint of a process identified by PID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDE_PID_SYSTEM_PROPERTY

public static final String IDE_PID_SYSTEM_PROPERTY
Name of the system property, which contains PID of running IDE. This property is set by ide executor of XTest framework.

See Also:
Constant Field Values
Method Detail

getIdeMemoryFootPrint

public static long getIdeMemoryFootPrint()
                                  throws MemoryMeasurementFailedException
Gets memory footprint of NetBeans IDE. This methods requires system property 'netbeans.pid' to contain PID of the IDE process.

Returns:
memory size value
Throws:
MemoryMeasurementFailedException - When measurement cannot be performed

getProcessMemoryFootPrint

public static long getProcessMemoryFootPrint(long pid)
                                      throws MemoryMeasurementFailedException
Gets memory footprint of a process identified by PID. On each platform this methods returns a platform specific value.

Parameters:
pid - process identification for the process, which size is to be measured
Returns:
memory size value
Throws:
MemoryMeasurementFailedException - When measurement cannot be performed

org.netbeans.modules.nbjunit/1 1.41

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.