NonStop Server for Java 7.0 Programmer's Reference

Miscellaneous changes for migration to TNS/E
“JNI_OnLoad and JNI_OnUnLoad functions” (page 96)
“Debugger” (page 96)
dlfcn.h file” (page 96)
JNI_OnLoad and JNI_OnUnLoad functions
All applications migrating from TNS/R systems must change the JNI_OnLoad function. The format
usage depends on the following system type:
On TNS/R systems, use the following command:
JNI_OnLoad_libname
where, libname is the name of the library that your program passed to the
System.loadLibrary function.
On TNS/E systems, use the following command:
JNI_OnLoad
On TNS/R systems, the JNI_OnUnload function is not supported by versions of NSJ available
for this platform.
On TNS/E systems, the JNI_OnUnload function is supported.
Debugger
Visual Inspect is the preferred debugger for applications on TNS/E. For debugging native code,
you can also use Native Inspect ($System.SYSnnn.EINSPECT command). For more information,
see “Debugging Java process” (page 99).
dlfcn.h file
All applications migrating from TNS/R that use the dlfcn.h file require code changes. On TNS/E,
NSJ versions 4, 5, 5.1, 6.0, and 7.0 do not use their own special version of dlfcn.h. Use the
file that exists in the include directory (/usr/include) of the system.
Java stack size
JVM reserves a portion of the Java stack for its runtime operations. This area of the stack is referred
as StackShadowArea, and its size can be set using the option XX:StackShadowPages. The
size used by this area is measured in units of page size. On NonStop systems, the page size is
16K bytes. For 32–bit NSJ7, the value of StackShadowPages is 2, and for 64–bit NSJ7, the
value is 3.
In NSJ7, the StackShadowArea is increased compared to earlier versions of NSJ. Thus, the
available space for Java methods is decreased by 16K bytes. When you migrate from earlier
versions of NSJ to NSJ7, if the application encounters the error
java.lang.StackOverflowError, then increase the value of stack size by using Xss or
ThreadStackSize options.
JNI application consideration
JNI applications cannot enable parallel and CMS GC if the JVM is loaded in the main thread. For
more information, see “Calling Java methods from C or C++” (page 37).
Dynamic snapshot
In NSJ7, the dynamic snapshot support is limited to capturing the snapshot of the Java process
only. For more information, see “Saveabend file generation” (page 46).
96 Migrating applications