This program gives the total memory occupied by the system. It also gives the output of total available system memory. Useful It projects for students. This program gives the total memory occupied by the system. It also gives the output of total available system memory. Useful It projects for students. Developed as a part of Java mini projects.
//**************************************
// Name: Memory Locator
// Description:It outputs the free memory and total memory of the system. It also outputs the system properties. (e.g. classpath..).
// By: notoryus
//
//This code is copyrighted and has// limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=3071&lngWId=2//for details.//**************************************
import java.util.*;
public class MemorySystem {
public static void main(String arg[]) {
System.out.print(“Coded by notoryus”+new Date());
Properties p = System.getProperties();
p.list(System.out);
Runtime rt = Runtime.getRuntime();
System.out.println(“total memory: ” + rt.totalMemory());
System.out.println(“free memory: ” + rt.freeMemory());
}
}