HP-UX Programmer's Guide for Java 2

Table Of Contents
Output:
aCC_main.o
Create the main program and link:
$ aCC -z -o aCC_main aCC_main.o \
-L<java_dir>/jre/lib/PA_RISC2.0/hotspot \
-ljvm -lpthread -llwp
NOTE: If you are using SDK 1.2 or 1.3 and your C main is linked EXEC_MAGIC so as
to be able to address more than 1GB of private data, you must either use Hotspot JVM
or the Classic JVM with the "-nojit" option. The JIT compiler in Classic 1.2 and 1.3
is not compatible with EXEC_MAGIC.
Output:
aCC_main
To execute the aCC main program, you need to set the following environment variables
so the JVM libraries can be loaded.
$ export SHLIB_PATH=<java_dir>/jre/lib/PA_RISC2.0:\
<java_dir>/lib/PA_RISC2.0/hotspot
$ export CLASSPATH=.
To access Integrity libraries change PA_RISC2.0 to IA64.
Now the program can be run:
./aCC_main
TestNonJavaCallingJava.printInt received: 100
Main/primordial thread stack size limits
The primordial thread is the first thread when a process is created. This is the thread
that has the main method. It is also called the main thread. The primordial thread stack
size is controlled by the kernel parameter maxssiz or maxssiz_64bit. The Java™ VM
(JVM) has two options for controlling the stack size:
-XX:MainThreadStackSize=n-Xss[n][k or m]
In the JVM, the size of the primordial thread is restricted to the greater of
MainThreadStackSize (default 2MB) or ThreadStackSize (specified by -Xss). For example,
if you specify -Xss1m, the JVM still takes 2MB for the main thread. And if you specify
-Xss4m, the JVM takes 4MB for the main thread as well.
If your application calls JNI_CreateJavaVM or JNI_AttachCurrentThread from
the primordial thread, under certain conditions the stack usage could cross the
JVM-imposed primordial thread stack size limit of 2M and cause a stack overflow
Main/primordial thread stack size limits 57