I hope this report is valid because I am not so familiar with how a program should use the ram and under which circumstances it should free it.
When I open a world, my ram usage goes up to about 550.000K. When I summon now entities and kill them again, it will still stay up that high.
A good way to reproduce it is first using this command
and then run:
/entitydata @e[type=ArmorStand,name=Test] {CustomName:Test}
For me it freezes (ram usage goes up to 1.310.000K) and then gives this error:
[17:36:54] [Client thread/FATAL]: Error executing task java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_25] at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_25] at g.a(SourceFile:61) [1.8.4.jar:?] at ave.av(SourceFile:880) [1.8.4.jar:?] at ave.a(SourceFile:325) [1.8.4.jar:?] at net.minecraft.client.main.Main.main(SourceFile:124) [1.8.4.jar:?] Caused by: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOfRange(Arrays.java:3664) ~[?:1.8.0_25] at java.lang.String.<init>(String.java:201) ~[?:1.8.0_25] at java.lang.StringBuilder.toString(StringBuilder.java:407) ~[?:1.8.0_25] at avu.a(SourceFile:40) ~[1.8.4.jar:?] at avt.a(SourceFile:139) ~[1.8.4.jar:?] at avt.a(SourceFile:129) ~[1.8.4.jar:?] at avt.a(SourceFile:125) ~[1.8.4.jar:?] at bcy.a(SourceFile:527) ~[1.8.4.jar:?] at fy.a(SourceFile:44) ~[1.8.4.jar:?] at fy.a(SourceFile:9) ~[1.8.4.jar:?] at fh$1.run(SourceFile:13) ~[1.8.4.jar:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_25] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_25] at g.a(SourceFile:60) ~[1.8.4.jar:?] ... 3 more
But the ram usage stays that high and doesn't decrease anymore until you close Minecraft
This means Minecraft neither frees ram when closing a world nor when killing entities (or when running commands). In some way the ram usage decreases, but it doesn't go back to about 550.000K.