University of California at Berkeley Department of Electrical Engineering & Computer Sciences Instructional & Electronics Support /usr/pub/java-cory.help http://www-inst.eecs.berkeley.edu/usr/pub/java-cory.help Nov 10, 1998 CONTENTS: Using the New Java Interpreter on cory.EECS Reading the Online Documentation What the New Java Interpreter Includes Using the new Just-in-Time Compiler JVM Bug Reports Release Notes for Java Just-in-Time Compiler For More Information Using the New Java Interpreter on cory.EECS ------------------------------------------- We are testing a new Java interpreter on cory.EECS and we'd like to hear your feedback. This Java interpreter, 1.1.7 from Digital Equipment's Java development team, offers significantly increased functionality over the SWW Java interpreter version 1.0.1. In order to use it, you must first set your path to have /usr/bin before /usr/sww/X11/bin; otherwise, you will get the older, SWW Java interpreter. To set your path correctly for your current login session, type these commands at your shell prompt: cory% set path = ( /usr/bin /usr/sww/X11/bin $path ) cory% rehash To make the change permanent, add the following to the end of your ".cshrc" file: if ( `hostname` == "cory.EECS.Berkeley.EDU" ) then # Use new Java interpreter. set path = ( /usr/bin /usr/sww/X11/bin $path ) endif Then, when you login, you can verify that you are using the new Java interpreter using the following two checks, which should produce exactly the output shown: cory% which java /usr/bin/java cory% java -version java version "1.1.7-beta1" Reading the Online Documentation -------------------------------- You can read the Digital Java documentation by opening your favorite Web browser on the HTML file "/usr/share/doclib/java/index.html" on cory.EECS. cory% netscape /usr/share/doclib/java/index.html or, if you would prefer not to start an X window: cory% lynx /usr/share/doclib/java/index.html What the New Java Interpreter Includes -------------------------------------- javac - Java compiler java - Java runtime engine jre - Java runtime-only interpreter jdb - Java debugger javah - Creates C header files and C stub files for Java classes javap - Disassembles compiled Java files javadoc - Generates API documentation in HTML format from Java code appletviewer - runs Java applets without a web browser. rmic - Generates skeleton class files for the java.rmi.Remote interface rmiregistry - remote object registry daemon; used by RMI servers serialver - Returns the serialVersionUID for one or more classes. native2ascii - Converts non-Unicode files to Unicode Latin-1. jar - Combines files into a Java Archive (JAR) javakey - Generates digital signatures for archive files Using the new Just-in-Time Compiler JVM --------------------------------------- The current Java installation on cory.EECS also includes an experimental Just-in-Time compiler as part of the Java Virtual Machine which can provide significant speed increases in some cases. Release notes for the new compiler are at the end of this document. However, the new JVM is experimental, and is therefore not enabled by default. In order to use this new virtual machine, use the "jit" command where you would ordinarily use the "java" command, e.g., to run a newly-generated "MyProgram.class" file which you compiled from a "MyProgram.java" file using the "javac" compiler. Conventional interpreter | Just-in-Time compiler -----------------------------------+--------------------------------- cory% javac MyProgram.java ---+--> cory% javac MyProgram.java cory% java MyProgram.java ---+--> cory% jit MyProgram.java Bug Reports ----------- If you have problems with the new Java Just-in-Time compiler or the new Java development environment as it is installed on cory.EECS, send bug reports to . To the staff: inconsistencies in the new Java interpreter should be reported to . Release Notes for Java Just-in-Time Compiler -------------------------------------------- Release Notes for the Fast Java Virtual Machine (Fast JVM) for DIGITAL UNIX - Beta-1 These release notes describe the beta-1 release of the new, Fast Java Virtual Machine (Fast JVM) for DIGITAL UNIX. IMPORTANT: * Please make sure you understand the [1]License information before using this release. Installation and Packaging For registration and installation, refer to the [2]Fast JVM index page. This beta version of the Fast JVM is packaged and installed separately from the JDK 1.1.6 but requires the prior installation of JDK 1.1.6 for DIGITAL UNIX. The beta version of the Fast JVM can be installed and used on a system along with the DIGITAL JDK 1.1.6 without affecting it. The Fast JVM installs a new `jit' command, which is used to invoke the Fast JVM. The `jit' command is similar to the JDK 1.1.6 `java' command but invokes the Fast JVM instead of the virtual machine included with JDK 1.1.6. Using the Fast JVM Beta The Fast JVM is used by invoking the `jit' command rather than the `java' command. The `jit' command supports most of the same options as the `java' command: % jit Usage: jit [-options] class [args] where options include: * -help -- print out this message * -version -- print out the build version * -v -verbose -- turn on verbose mode * -ss -- set the maximum native stack size for any thread * -ms -- set the initial Java heap size; default is 16mb * -mx -- set the maximum Java heap size; default is 128mb * -D= -- set a system property * -classpath -- list directories in which to look for classes * -verify -- verify all classes when read in * -verifyremote -- verify classes read in over the network [default] * -noverify -- do not verify any class The following `java' command options are accepted by the `jit' command but have no effect: * -cs -checksource -- check if source is newer when loading classes * -debug -- enable remote JAVA debugging * -jit -- use the just-in-time compiler (always on for `jit') * -noasyncgc -- don't allow asynchronous garbage collection * -noclassgc -- disable class garbage collection * -nojit -- use the interpreter * -oss -- set the maximum Java stack size for any thread * -prof[:] -- output profiling data to ./java.prof or ./ * -verbosegc -- print a message when garbage collection occurs The beta `jit' command also supports the following options that are primarily intended for JVM developers: * -c -- c compile only * -dcpi -- generate dcpi image * -nogc -- no garbage collection * -notls -- no thread local storage * -stats -- display interesting statistics The Fast JVM can also be used with the appletviewer as follows: % jit sun.applet.AppletViewer $* Known Problems * This beta version of the Fast JVM is intended to demonstrate future capabilities and to collect feedback concerning improvements that are needed. It is not intended for production use. Additional development work and testing is needed before the Fast JVM is suitable for production applications. * This beta version supports DIGITAL UNIX V4.0D only. We plan to support additional DIGITAL UNIX versions in the future. * For this beta, we are packaging the Fast JVM separately and do not permit redistribution. For the final version, we plan to package it in a manner to allow redistribution. * This beta version does not support object finalization. Calls to finalize () are recognized but ignored. In addition, objects that contain finalizers are not finished upon the death of the object. * On DIGITAL UNIX, the memory allocator uses mmap() system calls to obtain memory for the heap. Once the initial heap has been mapped, the allocator and collector map the same region with larger values to grow the heap, while maintaining a contiguous address space. It is essential that native methods which use mmap() do not map in the same region as the collector. The collector begins mapping at 0x40000000 and grows upward from that address. Refer to the manpages for additional information about how mmap() functions. * The DIGITAL Fast JVM tends to consume more memory for a given application than the DIGITAL JDK 1.1.6 implementation. This is due to a number of considerations, including object model definition, garbage collection algorithms and techniques, monitor and exception processing, class loading differences, etc. In general, for Beta-1, the Fast JVM trades heap size for speed. General Comments on Memory Management and Garbage Collection Memory management in the DIGITAL Fast Virtual Machine is provided by a generational, copying garbage collector based on the Bartlett model. This technique has been shown to be faster than the more common "mark and sweep" style collector employed, for example, by the DIGITAL JDK 1.1.6. For the purposes of Beta-1, memory management is synchronous. During a garbage collection cycle, all threads save the one running the collector are suspended. When the garbage collection cycle is complete, all threads are resumed. A variety of advanced techniques have been utilized in the development of this garbage collector to minimize "pause time" to avoid negatively impacting GUI programs. The garbage collector interacts with the just-in-time compiler to quickly map live objects within Java method contexts. Exhaustive searching (conservative scanning) of thread contexts occurs only for native methods. Access to the heap is managed at the thread level by locks. As a performance enhancement, each thread also manages a portion of the heap via thread local storage management techniques. For Beta-1, the allocator will prefer to place small objects in thread local storage. Every effort has been made to mimic the behavior of the DIGITAL JDK 1.1.6 with respect to memory management. The System package is fully supported, including System.gc(). All the command line switch settings related to garbage collection are recognized, although some are recognized only for command line compatibility and are ignored. The following switches are recognized and processed by the Fast JVM: * -ms set the initial Java heap size; default is 16mb * -mx set the maximum Java heap size; default is 128mb Note: The default sizes differ from the DIGITAL JDK 1.1.6. The following switches are recognized by the Fast Virtual Machine, but are ignored: * -noasyncgc don't allow asynchronous garbage collection * -noclassgc disable class garbage collection The following switches are recognized and processed by the Fast JVM, but produce different output than the DIGITAL JDK 1.1.6. * -verbosegc print a message when garbage collection occurs The following switches are unique to the Fast JVM. They are documented for the purposes of Beta-1, but are of limited value to application developers: * -nogc Disable garbage collection: all memory is allocated via conventional malloc() calls. * -notls Disable thread local storage allocation. All allocation occurs in the global heap. More Information and Problem Reporting If you identify any problems with the Fast JVM, please use the accompanying problem-report template ([3]bugreport.txt) to send a bug report to [4]java-bugs@zko.dec.com, specifying the following information; * A description of the problem * If possible, a test program to reproduce the problem. In addition to problem-reports, we are interested in receiving feedback around performance. Send that feedback along with any questions, suggestions, or comments you may have on the Fast JVM, to [5]java-info@zko.dec.com. You can look for updates to the Fast JVM when new revisions become available at our [6]Java web site. _________________________________________________________________ Modifications Copyright 1998 Digital Equipment Corporation Copyright © 1996, 1997, 1998 Sun Microsystems, Inc. 901 San Antonio Rd., Palo Alto, CA 94303 USA All rights reserved. References 1. file://localhost/home/ll/ugrad/brg/license.txt 2. file://localhost/home/ll/ugrad/brg/index.html 3. file://localhost/home/ll/ugrad/jdk_nt/1.1.6/bugreport.txt 4. mailto:java-bugs@zko.dec.com 5. mailto:java-info@zko.dec.com 6. http://www.digital.com/java For More Information -------------------- For more information, please read "/usr/pub/java.help". EECS Instructional & Electronics Support 377 & 386 Cory, 333 Soda root@cory.eecs.berkeley.edu labfix@eecs.berkeley.edu