Setting the Heap size of your JVM typically requires that you pass what is called
an "additional option" to your JVM. There are many additional options that a person
could pass to a JVM... for various reasons. When it comes to Heap size, there are
2 options in particular that you may need to use.
One of them is used to set the Min heap size, and the other is used to set the Max heap size.
If you would like to learn more about all of these "additional options" that Sun's JVM supports then please read
SE FAQ #182
If you are running SE in an out-of-process configuration (AS) then you must
do this by editing the StartServletExec script/batch file.
As the Javadocs (linked in the FAQ #182 pointed to above) explain, options are passed to a JVM like this:
java [ JVM options ] classname [ program arguments ]
This fact is also given in SE FAQ #33
As an EXAMPLE, here is the syntax for setting the Min heap to 128MB and the Max heap to 256MB:
java -Xms128M -Xmx256M -classpath "C:\myClasses;C:\myJars\a.jar" MyJavaClass arg01 val01 arg02 val02
If you are running SE in an in-process configuration (ISAPI or NSAPI) then
you must do this from the SE admin pages (in your browser).
You can use either:
- The VM Settings page to specify the Min and/or Max Heap size
- The VM Options page to specify the -Xms (for Min) and/or -Xmx (for Max) values
You would then need to cycle the JVM by cycling the webserver.
NOTE: for IIS 5 & 6, this means cycling the Windows service named "IIS Admin Service". For IIS 7 this means cycling the *single* IIS Application Pool in which SE ISAPI is running.
NOTE: If you then receive "Service Unavailable" responses when trying to access the SE Admin UI pages (or any servlet or JSP) then please read SE FAQ #367
If you are running SE ISAPI, then you should also be aware of an IIS limitation on the amount of RAM (i.e. heap) that
the JVM can grab. SE FAQ #317 explains.
For additional information about the Java Heap, you should also read:
SE FAQ #320 for more details.
Readers of this FAQ may also find FAQ #380 to be helpful.