Java Memory Total getTotalFreeMemory()

Here you can find the source of getTotalFreeMemory()

Description

get Total Free Memory

License

Open Source License

Declaration


public static long getTotalFreeMemory() 

Method Source Code

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

public class Main {

    public static long getTotalFreeMemory() {
        return getFreeMemory() + (getMaxMemory() - getAllocatedMemory());
    }//from   www  . j a va 2s.c o m

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

    public static long getMaxMemory() {
        return Runtime.getRuntime().maxMemory();
    }

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

Related

  1. getJavaTotalMemory()
  2. getJvmTotalMemory()
  3. getMemoryTotal()
  4. getTotalMemory()
  5. getTotalMemory()
  6. getTotalMemory(boolean preRunGarbageCollector)
  7. getTotalMemoryInKB()