How to improve the performance of java games

performance

Minecraft and Terraria both run incredibly slow on my machine. I've never seen anything like it, javaw.exe hammers my cpu – it's constantly at 100%. These aren't even graphically intensive games, they both use java, so I suspect that to be the reason.

I tried setting low render distance, 3D anaglyph to off, graphics to fast, but still minecraft became unplayable.

I uninstalled all previous versions of java and installed the latest version: jre7. I even tried running minecraft in very low resolution and it still killed by cpu. Reinstalling minecraft and java hasn't worked.

I've checked that nothing else is running, anti-virus autoscan is off.

I've managed to run hl2, portal, cod4, san andreas and other recent 3D games just fine, so it's very frustrating.

My specs:
Pentium 4 2.8GHz
1 GB RAM
NVIDIA 5600 64MB
Windows XP

Best Answer

You could try and tune javaw. To begin with i assume you run it like this :

C:\jdk6\bin\javaw.exe -jar "C:\jedit\jedit.jar"

To add parameters for tuning, it should then look like this :

C:\jdk6\bin\javaw.exe -Xmx256m -Xms256m -jar "C:\jedit\jedit.jar"

The above example allocates 256 MB heap memory for Java.

Further examples can be found in the Java Tuning White Paper.

Good luck :)