Communicator e3000 MPE/iX Release 6.0 Express 1 (C.60.01) (30216-90286)

52 Chapter3
Technical Articles
Java Developers Kit for MPE/iX Version 1.1.7B Release Notes
Heap Changes
The default minimum heap (java -ms option) has been changed from 64MB to 256KB in
version 1.1.7B. The default maximum value is still set to 64MB, which is under the
80,000,000 byte system default ;NMHEAP= limit and thus does not involve the problems of
;NMSTACK=. Should you need more than ~70MB of Java heap storage, you will need to both
specify the larger limit using the java -mx option AND specify a larger ;NMHEAP= value in
the same way that a larger ;NMSTACK= is specified.
The smaller default minimum heap value reduces the memory management overhead and
start-up time for the VM.
Extra Process Elimination at Start-up Time
One of the biggest reductions in start-up overhead was realized by eliminating the extra
fork/exec sequences of the standard VM start-up shell scripts.
On UNIX systems, processes are very cheap to start, and every time the shell wants to run
a program it simply forks and execs to do it. On MPE however, this is a VERY expensive
process.
In the JDK 1.1.5 version of Java/iX, if you want to execute the “javac” command to compile
a program, here’s what happens when the user types:
$ javac -g HelloWorld.java
The shell reads /usr/local/java/jdk1.1.5/bin/javac which is a symbolic link to
/usr/local/java/jdk1.1.5/bin/.java_wrapper.
The shell forks a copy of it self to read and execute the .java_wrapper script.
The .java_wrapper script executes three POSIX commands to break apart the $0
argument to the script. Each of these requires a fork and exec to create a new process
to run the command!
The .java_wrapper forks a new shell and it execs
/usr/local/java/jdk1.1.5/bin/PA-RISC/green_threads/javac which is yet
another shell script.
The /usr/local/java/jdk1.1.5/bin/PA-RISC/green_threads/javac script
invokes another script (another fork/exec) to break up the parameters to the javac
command. For EACH parameter, this script does MORE fork/execs to help chop up
the input.
Finally the /usr/local/java/jdk1.1.5/bin/PA-RISC/green_threads/javac
script execs /usr/local/java/jdk1.1.5/bin/PA-RISC/green_threads/java,
which is the actual VM executable, passing it the name of the javac class to be executed
to run the compilation.
The result of all this is that the user spends several seconds waiting while the system
forking repeatedly.
In 1.1.7B, all of the above nonsense has been replaced by a single program. All of the extra
fork/exec sequences are gone. The new start-up sequence looks like:
$ javac -g HelloWorld.java