Class MemoryUsageStress
- java.lang.Object
-
- org.jboss.test.clusterbench.common.load.MemoryUsageStress
-
public class MemoryUsageStress extends Object
Stressing MemoryUsageStress- Author:
- Michal Babacek Some reading: http://docs.oracle.com/javase/6/docs/api/java/lang/management/MemoryUsage.html http://stackoverflow.com/questions/3422557/sun-jvm-committed-virtual-memory-high-consumption
-
-
Constructor Summary
Constructors Constructor Description MemoryUsageStress()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetFreePhysical()MemoryUsagegetHeapMem()MemoryUsagegetNonHeapMem()StringgetStats()longgetTotalPhysical()StringstressSystemMemory(int megabytes, int milliseconds)stressSystemMemory JVM will be forced to put up a specified number of megabytes, thus affecting both memory allocated for JVM already and possible the physical memory as well (in case JVM will have to ask for more memory up to the maxMem constant).
-
-
-
Method Detail
-
stressSystemMemory
public String stressSystemMemory(int megabytes, int milliseconds)
stressSystemMemory JVM will be forced to put up a specified number of megabytes, thus affecting both memory allocated for JVM already and possible the physical memory as well (in case JVM will have to ask for more memory up to the maxMem constant).- Parameters:
megabytes-milliseconds-- Returns:
- status before and after the stress
-
getFreePhysical
public long getFreePhysical() throws JMException- Throws:
JMException
-
getTotalPhysical
public long getTotalPhysical() throws JMException- Throws:
JMException
-
getHeapMem
public MemoryUsage getHeapMem()
-
getNonHeapMem
public MemoryUsage getNonHeapMem()
-
getStats
public String getStats() throws JMException
- Throws:
JMException
-
-