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

50 Chapter3
Technical Articles
Java Developers Kit for MPE/iX Version 1.1.7B Release Notes
Performance Improvements and Resource Requirement Reductions
With 1.1.7B, several improvements were made to the MPE/iX implementation to reduce
the resources required for each instance of the Java Virtual Machine, and to reduce the
amount of time and overhead required to start a VM. These changed have resulted in the
elimination of approximately half of the start-up overhead.
Here is a summary of differences between 1.1.5 and 1.1.7B:
1.1.7 1.1.5
----------------------- -------------------- ------------------------
Thread stack allocation dynamic static (39MB stack req.)
# of Thread stacks dynamic fixed, ~35
max # of Threads limited by ;NMSTACK= fixed, ~35
Thread stack size 128KB 1MB
Min ;NMSTACK for shell default (2MB) works NMSTACK=40000000
Default min heap 256KB 64MB
Default max heap 64MB 64MB
Out of memory result Exception thrown VM aborts with SIGBUS
# of fork/exec to start 1 multiple, perhaps many
Can fork VM? yes no
Thread Stacks
Since the Java Virtual Machine is a multithreaded environment, a stack must be allocated
for each thread. Currently Java/iX uses a “Green Threads” package which simulates
multiple threads within a single process.
In 1.1.5, storage for thread stacks was statically allocated on the stack at start-up. This
resulted in several problems:
The number of threads that was supported was a fixed number.
The VM needed to run with ;NMSTACK=40000000, which required that the user enter
the POSIX environment using at least this large of an NMSTACK so that it would be
inherited by the eventual Java VM.
The first thread used the highest addresses in the stack, resulting in an apparent 39MB
stack size for even the most trivial Java program.
Functions invoked from within the VM that required executing a fork and exec
sequence would fail. This included executing shell commands and processes from within
Java, and the jdb Java debugger.
Running out of memory could cause an abort rather than throwing an
OutOfMemoryException.
The JIT required a large stack size, and could potentially run on any thread, so each
thread stack was allocated a full megabyte of storage.
In 1.1.7, the following changes have been made to address these problems:
Thread stacks are now allocated as needed, starting at low addresses in the stack. This
has reduced the minimum ;NMSTACK= requirements for the VM from nearly 40MB to
around 1.5MB. Because the shell now has a 2MB default NMSTACK, simple Java
programs can now be run without any special ;NMSTACK= parameter being specified
anywhere.