| NOTE: Some of the usage documentation previously included in these release notes has been moved to the Java for HP-UX Programmer's Guide at Programmer's Guide for Java™ 2
The Java for HP-UX Programmer's Guide at Programmer's Guide for Java™ 2 contains usage documentation for developers. There you will find information on HotSpot options, HP-specific optons and features, suggestions and examples for allocating memory, how to use WDB to examine backtraces in Java threads, code examples for using Java Native Interface, and much more.
Another change is that beginning with 5.0, we are combining the JDK, JRE, Runtime Plug-in, and Java WebStart technology release notes in this document.
JDK/JRE Usage
Removing support for unwanted architectures in the JRE
Under the JRE license agreement, partners who redistribute the JRE may remove support for unwanted architectures. Functional components may NOT be removed under any circumstances. You may remove support for unwanted architectures as follows:
The following commands assume that the JRE has been installed in the standard location, i.e. /opt/java1.5/.
- On PA-RISC, to remove 64-bit support:
/usr/sbin/swremove Jre15.JRE15-PA20W Jre15.JRE15-PA20W-HS
- On HP Integrity (Itanium), to remove 64-bit support:
/usr/sbin/swremove Jre15.JRE15-IPF64 Jre15.JRE15-IPF64-HS
Using WDB to examine backtraces in Java thread stacks
You can now use HP's debugger WDB 3.0.01 or later (the GNU Debugger GDB) to examine backtraces containing mixed language frames (Java and C/C++) in Java thread stacks. This will simplify debugging the VM and Java mixed-language applications. Set the environment variable GDB_JAVA_UNWINDLIB to the path name of the Java Unwind Shared Library libjunwind.sl (PA), which is in the SDK.
The default location of the Java Unwind Library in the SDK is:
/opt/java1.5/jre/lib/PA_RISC/server/libjunwind.sl
/opt/java1.5/jre/lib/PA_RISC2.0/server/libjunwind.sl
/opt/java1.5/jre/lib/PA_RISC2.0W/server/libjunwind.sl
/opt/java1.5/jre/lib/IA64N/server/libjunwind.so
/opt/java1.5/jre/lib/IA64W/server/libjunwind.so
Here are a few examples. In ksh, you would set the environment variable like this:
For 64-bit PA2.0 machines:
export export GDB_JAVA_UNWINDLIB=/opt/java1.5/jre/lib/\
PA_RISC2.0W/server/libjunwind.sl
For 64-bit HP Integrity 2 machines:
export GDB_JAVA_UNWINDLIB=/opt/java1.5/jre/lib/\
IA64W/server/libjunwind.so
If you installed the SDK in a location other than the default, you would substitute the non-default location for "/opt/java1.5" in the above commands. Then use WDB as usual to debug your Java applications or core files. See the tutorial slides on Debugging at Performance Tuning, Tutorials, & Training for help on how to use the new Java stack unwind functionality.
The Java for HP-UX Programmer's Guide at Programmer's Guide for Java™ 2 contains usage documentation for developers. There you will find information on HotSpot options, HP-specific optons and features, suggestions and examples for allocating memory, how to use WDB to examine backtraces in Java threads, code examples for using Java Native Interface, and much more.
Please refer also to Sun Microsystems' Java HotSpot VM Options at http://java.sun.com/docs/hotspot/VMOptions.html.
Support for C++ applications built with -AA and -AP options (PA-RISC)
Java supports the -AA and -AP options to build your C++ product. On HP Itanium systems, the C++ runtime libraries support -AA and -AP by default. On HP-UX 11.0 or 11.11 PA-RISC, if you are using the ANSI Standard C++ runtime (-AA) option in an application that loads Java, you need to use the -AA version of libjvm and libfontmanager. Note that these libraries are provided as a separate download on the same page from where you download the JDK and JRE, starting at this Webpage:
JDK, JRE, and Plug-In 5.0.x Downloads and Documentation
These are the Standard C++ Runtime version of these libraries:
./jre/lib/PA_RISC2.0/libjvm_v2.sl
./jre/lib/PA_RISC2.0W/libjvm_v2.sl
./jre/lib/PA_RISC2.0/libfontmanager_v2.sl
./jre/lib/PA_RISC2.0W/libfontmanager_v2.sl
The native application must be linked with, or must dynamically load these versions of the Java libraries if your C++ application is compiled using -AA.
The Standard C++ version of the JVM libraries are supported for PA_RISC2.0 and PA_RISC2.0W architectures only.
If the JVM is invoked through the standard Java driver, then use the -V2 option to use the Standard C++ runtime.
For example:
java -V2 <javaprog>
Using Java 2 JNI on HP-UX
For C and C++ applications, it is important to link with the -mt (multithread) option if the application calls a Java VM. Both executables and shared libraries must be linked with -mt. Use of -mt must be consistent during both compilation and linking. For more information, refer to the Native (non-Java) calling Java methods section in the Programmer's Guide.
If you embed libjvm in a 32-bit native application and wish to use a large Java heap, you must link with the -N option. Refer to the Expanding heap size in native applications on PA-RISC HP-UX 11.11 and later releases and Expanding heap size in native applications on Integrity HP-UX 11.23 and later releases for more information.
Garbage collectors: Parallel and Concurrent Mark Sweep
For a summary of changes in the garbage collector for version 5.0 refer to http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html The parallel collector (-XX:+UseParallelGC) has been enhanced in 5.0 to monitor and adapt to the memory needs of the application in order to eliminate the need to tune command-line options to achieve the best performance.
Allocating physical memory and swap in the Java heap
Since 1.4.1.05, the method of allocating physical memory and swap within the Java heap has changed. As a result, you are likely to see higher RSS (resident set size) memory usage when monitoring your Java processes with Glance or other tools, or your application startup may be slightly slower.
For more details on why this occurs and for examples of using key command line options, see: Allocating Physical Memory and Swap in the Java Heap.
Asian TrueType fonts and Asian locales
Asian Locales are supported by HP's JDK 5.0.17 with TrueType fonts. For more details, please refer to HP-UX Fonts and the Java™ Runtime Environment.
Date/Time methods defaults
The HotSpot JVM uses the gettimeofday() system call to obtain date and time information. For performance reasons a new mechanism that uses the number of CPU ticks since the application started is used to calculate the current time. As a result, changes to the system date or time using date(1), adjtime(2) or time synchronization utilities such as ntp will not be reflected in the date and time that the Java program returns, until the process is restarted.
If your application requires that system time changes are immediately reflected, you can use the
-XX:+UseGetTimeOfDay option to tell the JVM to use the gettimeofday call instead of the new, lightweight mechanism. However you may notice a drop in performance.
Profiling
Currently a SIGUSR2 handler to support -Xeprof profiling and a SIGPROF handler to support future profiling capability are installed automatically. This may cause incompatibilities with other native code or profiling tools which use SIGUSR2 or SIGPROF. You can turn off both handlers by using the following option -XX:+ReduceSignalUsage
However be aware that using this option also turns off the SIGQUIT handler, and you therefore will not be able to get a Java stack trace.
You can also turn off the SIGUSR2 handler only by using the following option -Xeprof:off. In this case you will retain the ability to get a Java stack trace using SIGQUIT. For more information about -Xeprof profiling, see the HP-UX Programmer's Guide for Java 2 at HotSpot Technology Tools and Commands
Closing a socket (PA-RISC only)
Because of changes to the mechanism by which a socket is closed in the VM, you no longer need to use the -XdoCloseWithReadPending option we recommended in earlier releases. For further information, refer to the HP-UX Programmer's Guide at HotSpot Technology Tools and Commands#socket
Compatibility with previous releases
Sun Microsystems maintains upward compatibility, therefore an application written for a 1.4 JVM will run on a 5.0 JVM. Downward compatibility is generally not supported, because new API's are introduced that cannot be run on earlier JVMs.
For a detailed description of the incompatibilities between 1.4 and 5.0, refer to http://java.sun.com/j2se/1.5.0/compatibility.html
Java Cryptography Extension (JCE) policy files
Due to import control restrictions for some countries, the Java Cryptography Extension (JCE) policy files shipped with the J2SE Development Kit and the J2SE Runtime Environment allow strong but limited cryptography to be used. These files are located at
<java-home>/lib/security/local_policy.jar
<java-home>/lib/security/US_export_policy.jar
where <java-home> is the jre directory of the JDK or the top-level directory of the J2SE Runtime Environment. An unlimited strength version of these files indicating no restrictions on cryptographic strengths is available on the JDK Web site for those living in eligible countries. Those living in eligible countries may download the unlimited strength version and replace the strong cryptography jar files with the unlimited strength files.
Unlimited strength Jurisdiction Policy Files may be downloaded from the JavaSoft's Web site. http://java.sun.com/products/jce/javase.html
Allocation Site Statistics and Zero Preparation Verbosegc
NOTE: To properly view Zero Preparation Verbosegc and Allocation Statistics information, you must use HPjmeter
3.1 or later.
Starting with the JDK 5.0.14 release, you can prompt the JVM to emit HP -Xverbosegc information for Java applications started without
-Xverbosegc. Zero Preparation Verbosegc allows you to obtain -Xverbosegc information from the JVM by sending the
running Java program a SIGPROF signal. For example, assuming the running Java process ID is 6754, then, executing
either of the two actions listed below prompts the JVM to start emitting detailed HP -Xverbosegc information:
kill -21 6754
kill -s sigprof 6754
Issuing a second SIGPROF signal to the running Java program prompts the JVM to stop emitting the -Xverbosegc information.
Similarly, issuing yet another SIGPROF signal to the running process prompts the JVM to start issuing -Xverbosegc
information one more time.
Additionally, starting with this release, and only if you had started the Java application with
-XX:+PrintAllocStatistics, when zero preparation verbosegc is enabled as specified in the previous paragraph, the
JVM also emits detailed allocation site statistics.
If you start your application with -XX:+PrintAllocStatistics, and if you do not specify
-Xverbosegc, or send the running process a SIGPROF signal, then the JVM will emit allocation site statistics
to standard out when the application terminates. (That is, when the Java process stops running.) If you do not want to
wait for the application to terminate, or if the application is designed to be long running (or does not terminate), then you can
obtain allocation site statistics by sending the running Java program a SIGPROF as described above.
Unlike -Xverbosegc information emission in zero preparation mode, which is started with a SIGPROF and stopped with a second
SIGPROF, when -XX:+PrintAllocStatistics is specified, allocation site statistics is emitted every time the JVM
receives a SIGPROF.
When -XX:+PrintAllocStatistics is specified along with -Xverbosegc, allocation site statistics data are
directed to the same output specified for HP -Xverbosegc. If no output file is specified, allocation site statistics are
directed to standard out (to the terminal where the program was started from). When -XX:+PrintAllocStatistics is
specified alone (without -Xverbosegc on the command line), allocation site statistics are directed to standard out
(to the terminal).
When a SIGPROF signal is sent to a running Java process that was originally started with
-XX:+PrintAllocStatistics on the command-line, the SIGPROF signal will also enable -Xverbosegc data collection
if -Xverbosegc was not specified on the command line when the program was started, and the output of both -Xverbosegc and allocation
site statistics is directed to a file created for you by the JVM. The name of the file created by the JVM has the following
format: java_<pid>.vgc. Where <pid> is the Java process id.
The following table lists all possible permutations and corresponding locations of emitted data for both allocation site
statistics and zero preparation verbosegc.
| Action |
JVM Flags Specified |
Allocation Site Statistics Data Location |
| No special action taken |
-XX:+PrintAllocStatistics -Xverbosegc |
Standard out |
| No special action taken |
-XX:+PrintAllocStatistics -Xverbosegc:file=mydata.vgc |
Same location as -Xverbosegc data file (mydata.vgc) |
| No special action taken |
-XX:+PrintAllocStatistics |
Standard out |
'kill -21 <pid>' |
-XX:+PrintAllocStatistics |
JVM will create a file for you, file name format is: java_<pid>.vgc |
| 'kill -21 <pid>' |
-XX:+PrintAllocStatistics -Xverbosegc |
Standard out |
| 'kill -21 <pid>' |
-XX:+PrintAllocStatistics -Xverbosegc:file=mydata.vgc |
Same location as -Xverbosegc data file (mydata.vgc) |
| 'kill -21 <pid>' |
-Xverbosegc |
Standard out |
| 'kill -21 <pid>' |
-Xverbosegc:file=mydata.vgc |
Same location as -Xverbosegc data file (mydata.vgc) |
|
 |
|
 |
Sending multiple SIGPROF signals to a running Java process produces multiple allocation site statistics dumps and
the JVM dumps the buffered data immediately after the SIGPROF is received. Allocation site statistics counters
inside the JVM are reset after each SIGPROF induced the dump of the data. HPjmeter consolidates data from
multiple allocation site statistics dumps into one report that is presented in a new tab in the -Xverbosegc data visualizer.
Allocation sites can originate from interpreted as well as compiled Java code, when specifying -XX:+PrintAllocStatistics,
and only allocations coming from compiled code are reported. The Java Virtual Machine detects and compiles the application’s
(and JDK's) most active Java methods as early as possible. Though reporting allocation sites originating from compiled code is
only incomplete from a comprehensive reporting point of view, it does always report the most active allocation sites (the sites most
likely to cause GC performance problems).
IPv6 support on Java 5.0
IPv6 is a set of Internet Protocol specifications designed to provide enhancements over the capabilities of the existing IPv4
service in terms of scalability, security, mobility, ease-of-configuration, and real-time traffic handling.
For more information about IPv6, see IPv6 Suppport in the HP-UX Java Programmer's Guide (http://docs.hp.com/en/JAVAPROGUIDE/hotspot.html#IPv6.)
HP-UX 11.11 (11i v1), 11.23 (11i v2), and 11.31 (11i v3) support dual protocol stacks IPv4 and IPv6. IPv6 is not currently supported on
HP-UX 11.0 or 11.22 (11i v1.5). In this SDK release, the IPv4 protocol stack is the default. To support IPv6, HP-UX 11.11 (11i v1)
requires HP-UX patches; HP-UX 11.23 (11i v2) and 11.31 (11i v3) do not.
For the availability of HP-UX patches required for IPv6 support on HP-UX 11i, please see:
» Patch information
» TOUR Transition
Patches for HP-UX 11i
When running Java 5.0, the IPv4 protocol stack is the default. To turn on IPv6 support, in addition to installing HP-UX patches for
HP-UX 11.11, you need to set the system property as follows:
java.net.preferIPv4Stack=false
Or, at the Java™ command line, you can use the option:
-Djava.net.preferIPv4Stack="false"
Beginning with JDK 1.5.0.15, you can use the properties file:
{JAVA_HOME}/jre/lib/net.properties
to set
  java.net.preferIPv4Stack=false
GC log-rotation support on JDK 5.0.17
Prior to JDK 5.0.17, when using GC logging options (for example, -Xverbosegc or
-Xloggc), GC data is written to a single file of unlimited size. Starting with JDK 5.0.17, the JVM supports
generation of multiple GC log files and rotates through the specified number of files. This allows for easier archiving
of GC data and helps limit the amount of disk space consumed by the GC log. Log rotation is also supported when using
zero-preparation Xverbosegc.
To enable log rotation, use the following option together with -Xverbosegc, -Xloggc, or zero-preparation
Xverbosegc:
-XX:GCLogLimits=M,N
M is a non-negative integer for the number of GC records per file. Each GC record corresponds
to a GC event. A value of 0 specifies an unlimited number of records per file.
N is a non-negative integer for the maximum number of files. A value of 0 specifies an
unlimited number of files.
When using this option, both M and N are required. If this option is not specified,
then the default behavior is to write a single GC log file with unlimited size.
When rotation is in effect, a sequence number is appended to the the GC filename (0 through N-1). (Examples of file names are:
filename.0, filename.1, and filename.2.)
With log rotation, when the specified maximum number of files (N) is reached, logging cycles back to the first file in the
sequence (filename.0), overwriting old GC data with new data. If the maximum number of files (N) is never reached, then no
log rotation occurs.
Examples:
Rotate between two log files, each with a maximum of 100,000 GC records:
-XX:GCLogLimits=100000,2
Maintain an unlimited number of smaller files, each with a maximum of 1,000 GC records:
-XX:GCLogLimits=1000,0
Configuring the Runtime Plug-In
For additional information on the Runtime Plug-In, refer to the Plug-In FAQs at
Java™ Runtime Plug-in (JPI) for 1.3, 1.4, 5.0, & 6.0 Frequently Asked Questions.
The JPI configuration has been redesigned in the 5.0 release. Please refer to Sun Microsystems' documentation at:
http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/jcp.html
CLASSPATH
A user's CLASSPATH environment variable can be passed by the JVM by running the Control Panel and specifying either '-cp' or '-classpath' in the "Java Run Time Parameter" box. You need to exit and rerun the browser for this change to take effect.
Java Webstart Technology Usage
Java™ Web Start is an application-deployment technology, which gives you the power to launch full-featured applications with a single click from a Web browser. It is located in the jre directory. Some of Java Web Start's features include:
- Runs independently of any browser, so you can shut down your browser or go to another Web page and continue using your application.
- Applications deployed with Java Web Start do not require a browser interface to operate.
- Includes security features of the Java 2 platform.
The hardware and operating system requirements for using Java Web Start are the same as those recommended for J2SE platform implementation on which it runs.
Upgrading from a Previous Java Web Start Version
Do NOT uninstall your previous version of Java Web Start (if you have one) before installing the new version. Uninstalling the previous version will cause the download cache to be cleared, and all of the previously installed Java Web Start applications will have to be downloaded again.
This version will overwrite previous installations and automatically update browsers to use this new release. If you want to reactivate a previous version after installing this new release, you have to re-install the old version. The configuration files and program files folder used by Java Web Start have not changed, so all your settings will remain intact after the upgrade.
Additional Java Web Start documentation
More information, including developer documentation, can be found in Sun Microsystems' documentation at: http://java.sun.com/products/javawebstart/reference/index.html.
Additional HP and Sun Java documentation
The following Web sites have additional information:
Java man pages (located at/opt/java1.5/man)
|