Java Memory Max getMaximumMemory()

Here you can find the source of getMaximumMemory()

Description

get Maximum Memory

License

Open Source License

Declaration

public static long getMaximumMemory() 

Method Source Code

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

public class Main {
    public static long getMaximumMemory() {

        long maximumMemory = Runtime.getRuntime().maxMemory();
        long totalMemory = Runtime.getRuntime().totalMemory();

        if ((maximumMemory <= 0) || (maximumMemory == Long.MAX_VALUE)) {
            // if maximum memory can not be determined or isn't defined, then default to the totalMemory
            maximumMemory = totalMemory;
        }/*from  ww w .j  a v  a 2s  .com*/
        return maximumMemory;
    }
}

Related

  1. freeMaxMemory()
  2. getJavaMaxMemory()
  3. getJvmMaxMemory()
  4. getMaximumMemory()
  5. getMaximumMemory()
  6. getMaximumMemory()
  7. getMaxMemory()
  8. getMaxMemory()
  9. getMaxMemoryStr()