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 Details

    • MemoryUsageStress

      public MemoryUsageStress()
  • Method Details

    • 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