Monday, November 10, 2008

How to enlarge the virtual memory for your Java Project

1. In order to run the commands correctly, you need go to the project directory where the classes located.
2. Type in the command prompt: \> java -classpath -Xmx[size] -Xms[size] [your main class name]
For example, if you want to enlarge the virtual memory to 256mb for your project phylotree (in which the main class file named PhyloTreeApp.java), the command should be:
\> java -classpath -Xmx256m -Xms256m PhyloTreeApp.java

Tips:

\>java -X : for the help
\>java -Xms: set initial Java heap size
\>java -Xmx: set maximum Java heap size

No comments: