/* * TestSystem.java * * Created on 07 December 2001, 11:43 */ package uk.ac.leeds.ccg.andyt.tests.java; /** * * @author andyt * @version */ public class TestSystem { /** Creates new TestSystem */ public TestSystem() { } /** * @param args the command line arguments */ public static void main (String args[]) { /* * Runtime tests */ // Get runtime instance Runtime runtime=java.lang.Runtime.getRuntime(); // Print out total virtual machine memory System.out.println("runtime.totalMemory() "+runtime.totalMemory()); System.out.println("runtime.totalMemory() is the total amount of memory available:\n" +"This may vary over time, depending on the host environment!"); System.out.println("runtime.freeMemory() "+runtime.freeMemory()); System.out.println("runtime.freeMemory() is an approximation of the amount of free memory available:\n" +"The difference between the top of the heap and the runtime.totalMemory()\n" +"(the heap is memory made available for allocating temporary variables.)"); // Garbage collect and print out total virtual machine memory again System.gc(); System.out.println("runtime.freeMemory() after garbage collecting "+runtime.freeMemory()); /* * System proporties */ System.out.println("java.io.tmpdir "+System.getProperty("java.io.tmpdir")); System.out.println("file.separator "+System.getProperty("file.separator")); System.out.println("line.separator "+System.getProperty("line.separator")); System.out.println("os.name "+System.getProperty("os.name")); //System.out.println(" "+System.getProperty("")); /* * Executing OS System commands */ //runtime.exec("cp "); } }