Java Memory Max getMaxMemory()

Here you can find the source of getMaxMemory()

Description

get Max Memory

License

Open Source License

Declaration

public static long getMaxMemory() 

Method Source Code

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

public class Main {
    public static long getMaxMemory() {
        return bytesToMegabytes(Runtime.getRuntime().maxMemory());
    }/* w w  w  .j ava  2 s .c o m*/

    private static long bytesToMegabytes(long bytes) {
        long MEGABYTE = 1024L * 1024L;
        return bytes / MEGABYTE;
    }
}

Related

  1. getMaximumMemory()
  2. getMaximumMemory()
  3. getMaximumMemory()
  4. getMaximumMemory()
  5. getMaxMemory()
  6. getMaxMemoryStr()
  7. getMemoryMax()
  8. getMemoryMax()
  9. jvmMaxMemory(String size, Boolean txtByte)