Java Memory Total getTotalMemory()

Here you can find the source of getTotalMemory()

Description

Gets current size of heap in bytes

License

Apache License

Declaration

public static long getTotalMemory() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**//  w  w w  .j av a2  s  . c o  m
     * Gets current size of heap in bytes
     */
    public static long getTotalMemory() {
        return Runtime.getRuntime().totalMemory();
    }
}

Related

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