Browse souce code repository at: https://github.com/jjYBdx4IL/java-evaluation/blob/master/src/test/java/tests/java/lang/RuntimeTest.java
package tests.java.lang;

import org.junit.Test;

//@meta:keywords:memory,ram,free ram,free memory,memory usage@
public class RuntimeTest {

    @Test
    public void test() {
        dumpMemInfo();
    }

    static void dumpMemInfo() {
        Runtime runtime = Runtime.getRuntime();

        long maxMemory = runtime.maxMemory();
        long allocatedMemory = runtime.totalMemory();
        long freeMemory = runtime.freeMemory();

        System.out.println(String.format("free memory:       %,11d kb", freeMemory / 1024));
        System.out.println(String.format("allocated memory:  %,11d kb", allocatedMemory / 1024));
        System.out.println(String.format("max memory:        %,11d kb", maxMemory / 1024));
        System.out.println(String.format("total free memory: %,11d kb",
            (freeMemory + (maxMemory - allocatedMemory)) / 1024));
    }

}
-------------------------------------------------------------------------------
Test set: tests.java.lang.RuntimeTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in tests.java.lang.RuntimeTest
test  Time elapsed: 0 s