Java on HP-UX 11i Frequently Asked Questions

Q: How can I exclude a method from HotSpot compilation?
A: Create a file in the home directory where the Java application will be started, name
it .hotspot_compiler and include entries describing the method(s) to exclude in the
form of:
exclude class_name method_name
for example:
exclude hpdocs/com/bean/PersistentBean addInnerPersistentFields
For more information on excluding methods, see the “HotSpot Technology Tools and
Commands” section of the HP-UX Programmer's Guide for Java 2 on the Business Support
Center at:
http://www.hp.com/go/hpux-java-docs.
Q: What is the maximum method code size for a Java class?
A: Currently, the JVM specification remains at 64K for max bytecode size of a method.
There are currently no plans to increase this by JavaSoft.
Q: What is the limit of the number of classes that can be loaded?
A: There is no limit to the number of classes that can be loaded other than memory.
Class definitions are loaded into the PermSpace by the class loader. When the PermSpace
fills up, and a Full GC is unable to free up space, you will begin to get
OutOfMemoryError exceptions. You can make the PermSpace larger by using
-XX:MaxPermSize=<value>. The default is 64MB. Prior to making a change, it may
be a good idea to run with -Xverbosegc and use HPjtune to observe the use of the
Permanent space. Also see the HP-UX Programmer's Guide for Java 2 on the Business
Support Center at:
http://www.hp.com/go/hpux-java-docs.
Q: What mechanism causes classes to be unloaded by the JVM?
A: When a class is referenced (i.e. with a new statement) for the first time, the class
definition is loaded using either the default class loader or a custom one if you've
defined one. The class definition is stored in an area of the Java heap called the Perm
Space. All allocated instances of that class definition have a reference back to the
reference stored in the Perm Space. When there are no longer any class instances that
reference that class definition, the definition becomes a candidate for collection. The
next time a full garbage collection takes place, all class definitions in the Perm Space
that aren't referenced by any actual instances will be cleaned up or unloaded. One way
to trigger a full garbage collection is if the Perm Space fills up. This can be seen by
watching the output of -Xverbosegc and looking for the cause of GC.
8