Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java get ram usage

MemoryUsage heapMemoryUsage = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
long maxMB = heapMemoryUsage.getMax()/(1024*1024);
long usedMB = heapMemoryUsage.getUsed()/(1024*1024);
 
PREVIOUS NEXT
Tagged: #java #ram #usage
ADD COMMENT
Topic
Name
9+8 =