I play Minecraft with about 100 mods and 32x32 texture pack. I've got min/max memory assigned 4GB and use 64Bit Java.

However, my due me teleporting a lot in my world my memory gets filled rather quickly, and I get that. But if I'm not in a place a long time, that cached memory should be flushed, but it is not.

Is there a JVM start command that aggressively flush cached memory regardless if it's needed or not in certain intervalls? Or even an option in-game for MinecrafT?

  • 1
    java GC only runs when memory starts to run out, otherwise running the GC when not needed slows down everything else Jan 19, 2014 at 16:16

1 Answer 1


Consider running your game with -Xincgc:

 C:\Program Files\Java\jre6\bin\java.exe" -Xincgc -Xmx4G 

Here is the description of what Xincgc does from Java.

-Xincgc: Enable the incremental garbage collector. The incremental garbage collector, which is off by default, will eliminate occasional garbage-collection pauses during program execution. However, it can lead to a roughly 10% decrease in overall GC performance.

There is some debate on whether or not this will improve performance on the client, however it is generally accepted as a common parameter when running servers.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .