Here you can find the source of writeMemory()
public static void writeMemory()
//package com.java2s; //License from project: Open Source License public class Main { public static void writeMemory() { Runtime rt = Runtime.getRuntime(); System.out.println("Total " + rt.totalMemory() + "\tMax " + rt.maxMemory() + "\tFree " + rt.freeMemory()); }/*from w ww .jav a2 s. c om*/ }