You can find how much memory JVM is using and available free memory using java.lang.Runtime class api's totalMemory() and freeMemory(). I am not sure how one can increase the memory for the JVM. It will be more specific to host OS.
It's worth mentioning that memory leaks are definitely not impossible in Java. If in your code you (for example) add Objects to a Collection without ever removing them, you will eventually run out of memory. As mentioned in the previous post the -Xms<size> (initial Java heap size) and -Xmx<size> (maximum Java heap size) allow you to set the heap size.
You can also set this permanently in the Java plugin e.g. on windows Start --> Settings --> control panel --> Java plugin. Click the advanced tab and then stick it in the Java Runtime Parameters field something like
SCJP 1.4, www.gsi3d.org.uk
Joined: Jun 29, 2002
Thanks for the help. I'm still trying to figure out what to do but all this points me in the right direction.