Depends on why it's going slow. If it's something like the JVM is spending a lot of time doing garbage collection due to you running close to your max heap size most of the time (defaults to 85 meg) then you can use the -Xmx command at run time to allocate more. You can also change which garbage collector, and some of its parameters too, but this is generally fine tuning, and won't fix problems like using an O(2^n) algorithm when an O(n^2) would do the job...