Created
April 9, 2013 13:47
-
-
Save tacksoo/5345797 to your computer and use it in GitHub Desktop.
Print out the number of cores
This file contains 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
public class Core { | |
public static void main(String[] args) { | |
int coreNum = Runtime.getRuntime().availableProcessors(); | |
System.out.println("Number of cores are: " + coreNum); | |
long maxMemory = Runtime.getRuntime().maxMemory(); | |
System.out.println("MAX size of the heap (MB): " + maxMemory / 1048576); | |
long freeMemory = Runtime.getRuntime().freeMemory(); | |
System.out.println("Free size of the heap (MB): " + freeMemory / 1048576); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment