Java Memory Usage memoryUsage()

Here you can find the source of memoryUsage()

Description

memory Usage

License

Apache License

Declaration

public static String memoryUsage() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String memoryUsage() {
        Runtime r = Runtime.getRuntime();
        long used = r.totalMemory() - r.freeMemory();
        return "usedHeap=" + (used / 1000000) + "MB, percent=" + (100.0 * used / r.maxMemory());
    }/*from w w w.  j  av a  2 s  .co  m*/
}

Related

  1. getMemoryUtiliztaion()
  2. getMemUsage()
  3. getPercentMemoryUsage()
  4. getStringMemoryUsage(String s)
  5. getUsageMemory()
  6. memoryUsage()
  7. memoryUsage()
  8. printMemoryUsage()
  9. reportMemoryUsage()