$ docker run --rm --memory=256m --entrypoint java flags-demo:jdk25 \
    -Xlog:gc -XX:MaxRAMPercentage=75 -cp /memoryhog.jar MemoryHog 24 200

[0.004s][info][gc] Using Serial
MemoryHog starting: chunk=24MB sleep=200ms
[0.048s][info][gc] GC(0) Pause Young (Allocation Failure) 1M->1M(7M) 0.713ms
held=24MB heapUsed=25MB heapMax=185MB freeHeap=6MB
[0.291s][info][gc] GC(1) Pause Young (Allocation Failure) 25M->25M(31M) 1.105ms
held=48MB heapUsed=49MB heapMax=185MB freeHeap=6MB
[0.507s][info][gc] GC(2) Pause Young (Allocation Failure) 49M->49M(77M) 0.643ms
held=72MB heapUsed=73MB heapMax=185MB freeHeap=27MB
[0.723s][info][gc] GC(3) Pause Young (Allocation Failure) 73M->73M(112M) 0.176ms
held=96MB heapUsed=98MB heapMax=185MB freeHeap=14MB
[0.962s][info][gc] GC(4) Pause Young (Allocation Failure) 98M->97M(147M) 23.535ms
held=120MB heapUsed=122MB heapMax=185MB freeHeap=24MB
[1.201s][info][gc] GC(5) Pause Young (Allocation Failure) 122M->121M(181M) 28.449ms
held=144MB heapUsed=146MB heapMax=185MB freeHeap=35MB
held=168MB heapUsed=170MB heapMax=185MB freeHeap=11MB
[1.633s][info][gc] GC(6) Pause Full (Allocation Failure) 170M->169M(185M) 5.895ms
[1.649s][info][gc] GC(7) Pause Full (Allocation Failure) 169M->169M(185M) 15.822ms
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at MemoryHog.main(MemoryHog.java:21)
exit=1
