Last active
July 20, 2018 07:09
-
-
Save arwankhoiruddin/99b4cc4c66d6944b9588986b67ef10a2 to your computer and use it in GitHub Desktop.
Get available processor and free memory using Java
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
import java.util.*; | |
public class GetInfo { | |
public static void main(String[] args) { | |
Properties p = System.getProperties(); | |
// p.list(System.out); | |
System.out.println("Total CPU: " + Runtime.getRuntime().availableProcessors()); | |
System.out.println("Free memory: " + Runtime.getRuntime().freeMemory()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment