Here you can find the source of getFreeMemoryKb()
public static long getFreeMemoryKb()
//package com.java2s; //License from project: Apache License public class Main { public static long getFreeMemoryKb() { return kb(Runtime.getRuntime().freeMemory()); }//from www .j a va2 s . com public static long kb(long memBytes) { return memBytes / 1024; } }