Java Memory Free freeAllocatedMemory()

Here you can find the source of freeAllocatedMemory()

Description

Returns the amount of free memory in the Java Virtual Machine.

License

Open Source License

Return

an approximation to the total amount of memory currently available for future allocated objects, measured in bytes.

Declaration

public static long freeAllocatedMemory() 

Method Source Code

//package com.java2s;

public class Main {
    /**//from w w  w. ja va2s  . c  o  m
     * Returns the amount of free memory in the Java Virtual Machine. Calling
     * the {@link Runtime#gc()} method may result in increasing the value
     * returned by freeMemory.
     *
     * @return an approximation to the total amount of memory currently
     * available for future allocated objects, measured in bytes.
     */
    public static long freeAllocatedMemory() {
        return Runtime.getRuntime().freeMemory();
    }
}

Related

  1. belowMemoryLimit(int percentFree)
  2. checkFreeMemory(long requiredMemory)
  3. formatMemorySize(Long afreeDiskSpace)
  4. freeMemory()
  5. freeMemory()
  6. freeMemory()
  7. freeMemory()