This summer I was running Java programs that were running out of memory. By default the maximum heap size for Java programs is 64MB. You can specify the maximum heap size when running your programs from the command line. The following runs the class file “classfile” with a maxium of 1024 MB.
java -Xmx1024m classfile
You can also specify the starting heap size.
java -Xms512MB -Xmx1024m classfile