Created
December 8, 2015 09:40
-
-
Save c9n/72e7e9b11844c1c8d973 to your computer and use it in GitHub Desktop.
Java - Get max heap size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// javac Test.java | |
// java -Xmx512m Test | |
public class Test { | |
public static void main(String[] args) { | |
System.out.println("----------"); | |
long max = Runtime.getRuntime().maxMemory(); | |
System.out.println(max/1024/1024 + "M"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment