Java Memory Available availableMemory()

Here you can find the source of availableMemory()

Description

Returns the amount of available memory (free memory plus never allocated memory).

License

Open Source License

Declaration

public static long availableMemory() 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from  w  ww  .  ja  v a2 s  .co  m*/
     * Returns the amount of available memory (free memory plus never allocated memory).
     */
    public static long availableMemory() {
        return Runtime.getRuntime().freeMemory()
                + (Runtime.getRuntime().maxMemory() - Runtime.getRuntime().totalMemory());
    }
}

Related

  1. availableMemory()
  2. availableMemory()
  3. availableMemoryPercent()
  4. getAvailableMemory()
  5. getAvailableMemory()