Java Memory Usage getUsageMemory()

Here you can find the source of getUsageMemory()

Description

get Usage Memory

License

Open Source License

Declaration


public static long getUsageMemory() 

Method Source Code

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

public class Main {

    public static long getUsageMemory() {
        return getAllocatedMemory() - getFreeMemory();
    }/*from w  ww.j av  a2  s  .c  o m*/

    public static long getAllocatedMemory() {
        return Runtime.getRuntime().totalMemory();
    }

    public static long getFreeMemory() {
        return Runtime.getRuntime().freeMemory();
    }
}

Related

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