1 package test.prefuse; 2 3 public class TestConfig { 4 5 public static boolean verbose() { 6 String v = System.getProperty("verbose"); 7 return ( v != null && v.equalsIgnoreCase("true") ); 8 } 9 10 public static String memUse() { 11 long total = Runtime.getRuntime().totalMemory() / (2<<10); 13 long free = Runtime.getRuntime().freeMemory() / (2<<10); 14 long max = Runtime.getRuntime().maxMemory() / (2<<10); 15 return "Memory: " + (total-free) + "K used / " 16 + total + "K avail / " 17 + max + "K max"; 18 } 19 20 } 21 | Popular Tags |