KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > prefuse > TestConfig


1 package test.prefuse;
2
3 public class TestConfig {
4     
5     public static boolean verbose() {
6         String JavaDoc v = System.getProperty("verbose");
7         return ( v != null && v.equalsIgnoreCase("true") );
8     }
9     
10     public static String JavaDoc memUse() {
11         // memory usage
12
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