Previous     Contents     Index     DocHome     Next     
iPlanet Web Server, Enterprise Edition Programmer's Guide to Servlets



Appendix C   JVM Configuration


The Java Virtual Machine (JVM) works by default without any additional configuration if properly set up.

However, if you need to specify settings for the JVM, such as additional classpath information, you can configure the JVM properties for iPlanet Web Server via the Administrator interface. You can add as many other properties as you want to (up to 64).



Note A few attributes on the Configure JVM Attributes page on the Java tab show as "Default." Since you can use different JVMs, these default values are unknown. You cannot query a JVM to find out the actual default values; instead, refer to your JVM documentation. For example, for Sun's JVM, if you choose Yes for the JIT Compiler option, it shows as "Default" because JIT is enabled in the JVM by default. However, if you choose No for the JIT compiler, an explicit entry, jvm.compiler=NONE, is added to the jvm12.conf file.



For information about JVM, see The Java Virtual Machine Specification from Sun at:

http://java.sun.com/docs/books/vmspec/2nd-edition/html/VMSpecTOC.doc.html



The jvm12.conf File



You can also configure JVM parameters by editing the jvm12.conf configuration file, which resides under the server's config directory.

For example, to disable JIT, you can add the following line to jvm12.conf:

java.compiler=NONE

Here is an example jvm12.conf file. The jvm.classpath value must be all on one line in the actual file.

[JVMConfig]
#jvm.minHeapSize=1048576
#jvm.maxHeapSize=16777216
#jvm.enableClassGC=0
#jvm.verboseMode=1
#jvm.enableDebug=1
#jvm.printErrors=0
#jvm.option=-Xrunoii
#jvm.profiler=optimizeit
#jvm.disableThreadRecycling=0
#jvm.serializeAttach=0
#jvm.stickyAttach=0
#jvm.trace=5
#java.compiler=NONE
#OPTITDIR=D:/App/IntuitiveSystems/OptimizeIt30D
#jvm.serializeFirstRequest=0
#jvm.include.CLASSPATH=1
#nes.jsp.forkjavac=0
#nes.jsp.enabledebug=1
jvm.classpath=/usr/java/tools.jar

Generally you should use plain property options (like name=value) for the JDK1.2 configuration and jvm.option=options for JVM-vendor dependent configurations. There can be multiple occurrences of jvm.option parameters.

A list of debugging options that you can include in the jvm12.conf file if the JPDA is installed is available here:

http://java.sun.com/products/jpda/doc/conninv.html#Invocation

For more information about debugging servlets and JSPs and the jvm12.conf parameters required for debugging, see Chapter 5 "Debugging Servlets and JSPs."



Using JVM Environment Variables



If you define JVM environment variables using the jvm.option setting in the jvm12.conf file or the Administration Server, servlets do not recognize them. Just use the plain name=value format for environment variables.

When you are running a stand-alone command line java program, use the following option to pass system properties into the java program:

java -Dorg.omg.CORBA.ORBClass=com.inprise.vbroker.orb.ORB myprogram

In the myprogram.java file, the following line retrieves the system property set above:

System.out.println("org.omg.CORBA.ORBClass="+System.getProperty("org.omg.CORBA.ORBClass"));

If you want to do the same thing for servlets in iPlanet Web Server, you need to put the following line in the jvm12.conf file:

org.omg.CORBA.ORBClass=com.inprise.vbroker.orb.ORB

Do not use jvm.option settings such as the following:

jvm.option=-Dorg.omg.CORBA.ORBClass=com.inprise.vbroker.orb.ORB

or

jvm.option=org.omg.CORBA.ORBClass=com.inprise.vbroker.orb.ORB

In the servlet or JSP, you can use the following line to retrieve the system property set above:

out.println("org.omg.CORBA.ORBClass="+System.getProperty("org.omg.CORBA.ORBClass"));



jvm12.conf Parameter Reference



The JVM parameters you can set in the jvm12.conf file are listed in Table C-1.


Table C-1    jvm12.conf settings

Setting

Allowed Values

Default Value

Description

jvm.minHeapSize  

 

1048576 (1 MB)  

The minimum heap size allocated to Java.

For Solaris, change this value to 3145278 (3 MB). For HPUX, change this value to 4194304 (4 MB). For all other operating systems, 1 MB is ideal.  

jvm.maxHeapSize  

 

16777216 (16 MB)  

The maximum heap size allocated to Java.  

jvm.enableClassGC  

0 (off), 1 (on)  

0  

Enables or disables class garbage collection.

Use instead of -Xnoclassgc.  

jvm.verboseMode  

0 (off), 1 (on)  

0  

Enables or disables JVM verbose mode. If on, the JVM logs a commentary on what it is doing, such as loading classes. The commentary appears in the error log.  

jvm.enableDebug  

0 (off), 1 (on)  

0  

Enables or disables JVM remote debugging.

Use instead of -Xdebug.

For more information about remote debugging, see Chapter 5 "Debugging Servlets and JSPs."  

jvm.printErrors  

0 (off), 1 (logs to log file), 2 (logs to stderr)  

0  

Enables or disables reporting of errors through vfprintf.  

jvm.option  

 

 

Allows you to set vendor JVM options.

The following options are ignored, because there are equivalents to these settings: -D, -Xnoclassgc, -Xdebug, -Xms, -Xmx, -verbose  

jvm.profiler  

 

 

Specifies the profiler. If you use the optimizeit profiler from Intuitive Systems, you must also set the OPTIDIR setting.

For more information about this optimizer, see Appendix D "Remote Servlet Profiling."  

jvm.disableThreadRecycling  

0 (off), 1 (on)  

0  

Enables or disables thread recycling. If on, the server always creates a global scope thread to execute servlets. Otherwise a global scope thread is created only when the request handling thread is not in the global scope.  

jvm.serializeAttach  

0 (off), 1 (on)  

0  

If on, threads that attach to the JVM are serialized. By default (if off), threads can attach to the JVM in parallel.  

jvm.stickyAttach  

0 (off), 1 (on)  

0  

Setting the value of this parameter to 1 causes threads to remember that they are attached to the JVM.

This speeds up request processing by eliminating AttachCurrentThread and DetachCurrentThread calls. It can, however, have a side-effect: recycled threads which may be doing other processing can be suspended by the garbage collector arbitrarily.

Thread pools can be used to eliminate this side effect for other subsystems. For more information about thread pools, see the iPlanet Web Server Administrator's Guide.

 

jvm.trace  

 

5  

Determines the trace level. For servlet and JSP debugging, the recommended level is 7. Level 5 displays servlet engine messages. Level 6 displays servlet and JSP engine messages. Level 7 displays these and other exceptions in the browser.  

jvm.allowExit  

0 (off), 1 (on)  

0  

Enables or disables exit from the process.  

java.compiler  

 

 

Specifies the Java compiler. See your JVM documentation for options that turn the JIT (just in time) compiler on and off. This should be set to NONE when jvm.enableDebug is on.  

OPTITDIR  

A path  

*  

Specifies the path to the profiler if the profiler is optimizeit.  

nes.jsp.enabledebug  

0 (off), 1 (on)  

1  

Enables or disables verbose JSP compilation tracing.

For more information about remote debugging, see Chapter 5 "Debugging Servlets and JSPs."  

jvm.include.CLASSPATH  

0 (off), 1 (on)  

1  

Specifies whether to include the CLASSPATH environment variable value in the jvm.classpath setting.  

nes.jsp.forkjavac  

0 (off), 1 (on)  

0  

If on, Java compilation of JSPs runs in a separate process.  

jvm.serializeFirstRequest  

0 (off), 1 (on)  

1 for Linux, AIX, and Compaq (DEC);
0 for other platforms
 

If on, ensures that only one request thread loads and constructs a servlet object. Once a servlet is loaded and initialized, new requests to the same servlet happen in parallel. This setting must be on for Linux, AIX, and Compaq (DEC).  

jvm.classpath  

A path with forward slashes only  

 

Specifies the path(s) to JAR files dependent on the JVM. Enter additional classpath values as needed.

For example, if a JSP uses a bean that is packaged in a JAR, add the JAR path to the classpath.

If you are using a session manager that uses a JDBC driver, be sure to include the driver's JAR file in this classpath.  

* N:/App/IntuitiveSystems/OptimizeIt30D, where N is the drive on which OptimizeIt is installed.


Previous     Contents     Index     DocHome     Next     
Copyright © 2001 Sun Microsystems, Inc. Some preexisting portions Copyright © 2001 Netscape Communications Corp. All rights reserved.

Last Updated May 02, 2001