Java Memory Usage getMemoryUsage()

Here you can find the source of getMemoryUsage()

Description

get Memory Usage

License

Open Source License

Declaration

public static String getMemoryUsage() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static final long MB = 1024 * 1024;

    public static String getMemoryUsage() {
        return ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / MB) + "/"
                + (Runtime.getRuntime().totalMemory() / MB) + "/" + (Runtime.getRuntime().maxMemory() / MB + " Mb");
    }/*w  w w  .j  av a 2  s. co  m*/
}

Related

  1. getMemoryUsage()
  2. getMemoryUsage()
  3. getMemoryUsage()
  4. getMemoryUsage()
  5. getMemoryUsage()
  6. getMemoryUsage()
  7. getMemoryUsage()
  8. getMemoryUsage()
  9. getMemoryUsageSimpleHr()