Arbortext Command Language > set Command Options > set javavmmemory
  
set javavmmemory
set javavmmemory= n
This option specifies the maximum size, in megabytes, of the Java Virtual Machine (JVM) memory allocation pool. The default value is 2048 for 64-bit machines, and 256 for 32-bit machines. Reduce this value if Arbortext Editor or Arbortext Publishing Engine cannot allocate enough memory as specified by this option.
* 
If the environment variable APTJAVAVMMEMORY is set, the required size of the JVM is set at startup of Arbortext Editor, and any subsequent set javavmmemory commands are ignored.
If APTJAVAVMMEMORY is not set, the setting for set javavmmemory is evaluated when the first java_type function is called in a Arbortext Editor session. Subsequent changes to set javavmmemory will not affect the running Java Virtual Machine unless you exit Arbortext Editor and start a new session. Consequently, when using the java_type functions, you should set javavmmemory before invoking a java_type function.
If set javavmmemory is used with Arbortext Publishing Engine, you should protect it from being sourced again after the JVM has started. Put the set javavmmemory statement inside an appropriate if statement. For example:
# Try to change this value only if the JVM has not started yet.
# This protects from failure in case this file is sourced again
# after the JVM has already started.
if (!java_init()) {
set javavmmemory=500
}
If you experience difficulty starting the JVM, it's possible that the memory allocation is higher than your operating system can accommodate. Try setting the javavmmemory value lower (for example, on a 32-bit machine, to a value below 900) to see if the JVM will start.
On a 64-bit machine, the maximum size is essentially unlimited. However, setting the value too high can decrease performance due to paging of virtual memory to disk. Commonly, it should be substantially less than the physical RAM on the system. For example, if you have 4GB RAM, try setting javavmmemory to 2000. If publishing extremely large documents results in failures with the error FATAL ERROR - Java has run out of memory. messages, try increasing the value until the error no longer occurs.
For more information about tuning the JVM, go to:
java.sun.com/performance/reference/whitepapers/tuning.html
Related Topics
java_constructor function
java_instance function
java_static function
java_delete function
append_javaclass_path function
set javaclasspath command
set javadebugport command
set javavmargs command
set javavmpath comand