aboutsummaryrefslogtreecommitdiffstats
path: root/src/ru/olamedia/debug/SystemInfo.java
blob: 30060a5c0bdef2039af9c4ca38fd58f98b365c2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package ru.olamedia.debug;

public class SystemInfo {
	public static void dump() {
		int cpu = Runtime.getRuntime().availableProcessors();
		long maxMemory = Runtime.getRuntime().maxMemory();
		long totalMemory = Runtime.getRuntime().totalMemory();
		long freeMemory = Runtime.getRuntime().freeMemory();
		// String country = System.getProperty("user.country");
		String username = System.getProperty("user.name");
		String os = System.getProperty("os.name");
		String osver = System.getProperty("os.version");
		String arch = System.getProperty("os.arch");
		System.out.println("Hello, " + username + " :)");
		System.out.println("" + os + " " + arch + " " + osver);
		System.out
				.println("Total CPU: " + cpu + " Memory free/total/max: "
						+ ((int) Math.floor(freeMemory / (1024 * 1024))) + "/"
						+ ((int) Math.floor(totalMemory / (1024 * 1024))) + "/"
						+ ((int) Math.floor(maxMemory / (1024 * 1024))));
		System.out.println(System.getProperty("java.vendor") + " " + System.getProperty("java.version"));
		System.out.println(System.getProperty("java.runtime.name") + " " + System.getProperty("java.runtime.version"));
	}
}