デバッグ用途†
クラスパス表記†
//クラスパス表示
String classpath = System.getProperty("java.class.path");
java.util.StringTokenizer st = new java.util.StringTokenizer(classpath,";");
while (st.hasMoreTokens()){
System.out.println(st.nextToken());
}
ヒープサイズ表示†
MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
MemoryUsage heapUsage = mbean.getHeapMemoryUsage();
long init = heapUsage.getInit();
long used = heapUsage.getUsed();
long committed = heapUsage.getCommitted();
long max = heapUsage.getMax();
System.out.println("memory" + (max - used) / 1024);
Counter: 7238,
today: 1,
yesterday: 2