Java Memory Max maxMemory()

Here you can find the source of maxMemory()

Description

max Memory

License

Open Source License

Declaration

public static String maxMemory() 

Method Source Code

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

public class Main {
    private static final long MEGA = 1024 * 1024;

    public static String maxMemory() {

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

        return convertLongToMega(maxMemory);

    }/*ww  w. java 2s  .co m*/

    private static String convertLongToMega(long value) {

        long megaValue = value / MEGA;

        String result = Long.toString(megaValue) + " MB";

        return result;

    }
}

Related

  1. getMemoryMax()
  2. getMemoryMax()
  3. jvmMaxMemory(String size, Boolean txtByte)
  4. maxMemory()
  5. maxMemory()
  6. maxMemory()
  7. maxMemory()
  8. maxMemoryb()
  9. maxMemoryInMbs()