Java Memory Total totalMemory()

Here you can find the source of totalMemory()

Description

Returns the total amount of memory in the Java virtual machine.

License

Open Source License

Return

the total amount of memory currently available for current and future objects, measured in bytes.

Declaration

public static long totalMemory() 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from   w w  w  .j  a  va2s  .  c  om*/
     * Returns the total amount of memory in the Java virtual machine.
     * The value returned by this method may vary over time, depending on
     * the host environment.
     * <p>
     * Note that the amount of memory required to hold an object of any
     * given type may be implementation-dependent.
     *
     * @return  the total amount of memory currently available for current
     *          and future objects, measured in bytes.
     */
    public static long totalMemory() {
        return Runtime.getRuntime().totalMemory();
    }
}

Related

  1. getTotalMemoryInMb()
  2. jvmTotalMemory(String size, Boolean txtByte)
  3. memoryTotal()
  4. totalMemory()
  5. totalMemory()
  6. totalMemory()
  7. totalMemoryb()
  8. totalMemoryMB()
  9. totalMemoryMB()