HP-UX Programmer's Guide for Java 2

Table Of Contents
Tells the JVM to reserve the swap space for all large memory regions used by the JVM
(Java™ heap). This effectively removes the MAP_NORESERVE flag from the mmap call
used to map the Java™ heaps and ensures that swap is reserved for the full memory
mapped region when it is first created. When using this option the JVM no longer needs
to touch the memory pages within the committed area to reserve the swap and as a
result , no physical memory is allocated until the page is actually used by the application.
Examples
-Xmx1500M
The initial Java™ heap memory commitment will be relatively small. This approach
maximizes the availability of system swap across your application machine. In SDK
1.4.1.05, the initial JVM footprint increases by about 22Mb; in SDK 1.4.2.00, it increases
by approximately 33Mb.
-Xmx1500M -Xms1500M
The initial Java™ heap memory commitment will be 1500Mb. You may notice a pause
during startup, even on a fast machine, as the memory pages are touched. In this case
it would be better to use the -XX:+ForceMmapReserved option because it uses
memory more efficiently. If your application typically uses less memory than this,
setting -Xmx and -Xms to the same value does not make the most efficient use of system
shared memory. You may want to use a smaller value for -Xms instead.
-Xmx1500M -XX:+ForceMmapReserved
There will be no pause corresponding to initial memory commitment. 1500Mb of swap
is reserved for the Java™ application. This swap cannot be shared with any other
processes on the system.
Application-dependent considerations using large heap size HP-UX 11i
PA-RISC
Thread stacks and C heap are allocated from the same address space as the Java™ heap,
so if you set the Java™ heap too large, new threads may not start correctly. Or other
parts of the runtime or native methods may suddenly fail if the C heap cannot allocate
a new page. An application may start up correctly with a 1.7GB heap, but this does not
necessarily mean it's going to work correctly.
For example, if you use a 1MB stack size (-Xss1m), and there are about 80 threads in
the process, you will have 80MB for stacks. If you have native libraries, you would
probably add another 64MB for C heap. You have now used a total of 144MB of your
heap for stacks and C heap, so this address space is not available for Java™ heap.
Because all programs have varying C heap requirements and have varying numbers
of threads, it's difficult to ascertain what the effect will be of running the application
at its limit. It's important to understand the real requirements of your application. We
66 Expanding Memory