// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.ArrayList;
import java.util.List;

public class MemIncr {
    public static void main(String[] args) {
        Runtime rt = Runtime.getRuntime();
        List<byte[]> lst = new ArrayList<byte[]>();
        while(true) {
            System.out.println((rt.totalMemory() - rt.freeMemory()) + " out of " + rt.totalMemory() + " used (max is " + rt.maxMemory() + ")");
            lst.add(new byte[1000000]);
        }
    }
}
