The really critical vm arg is -Xmx1024m
, which tells the VM to use up to 1024 megabytes of memory. The simplest solution is to use a bigger number there. You can try -Xmx2048m
or -Xmx4096m
, or any number, assuming you have enough RAM in your machine to handle it.
I'm not sure you're getting much benefit out of any of the other VM args. For the most part, if you tell Java how much space to use, it will be smart with the rest of the params. I'd suggest removing everything except the -Xmx
param and seeing how that performs.
A better solution is to try to improve your algorithm, but I haven't yet read through it in enough detail to offer any suggestions.