Hitachi

uCosminexus Application Server Expansion Guide


7.13.2 Using the Explicit Memory Management functionality by using the automatic placement configuration file

Set the automatic placement functionality in the Explicit Memory Management functionality by using the automatic placement configuration file. If you use the automatic placement configuration file, you can use the Explicit Memory Management functionality without making changes to the Java program.

In the automatic placement configuration file, specify objects that you want to place in the Explicit heap and the location of generating the objects. Note that the objects that are being referenced from the objects that you specify in this file (objects generated in the Explicit memory block) move to the Explicit memory block from the Java heap. For details on the object movement, see 7.6.5 Moving the objects from the Java heap to the Explicit memory block based on a reference relation.

This subsection describes the coding format of the automatic placement configuration file and points you need to consider during coding, if you use the Explicit Memory Management functionality by specifying the -XX:+HitachiAutoExplicitMemory option and by using the automatic placement configuration file.

You can code the contents of the automatic placement configuration file by using one of the following items:

Organization of this subsection

(1) Coding format of the automatic placement configuration file

Coding format of the automatic placement configuration file is as follows.

<Generation point>#, <fully classified class name of the specified object> # Comment
:
<Generation point>#, <fully classified class name of the specified object>
#

Examples of the specification of generation point are described below.

Example of generation point

Meaning

*

This specifies generation of the user-specified objects in all the methods that are included in all classes in all packages, as the generation point.

com.sample.*

This specifies generation of the user-specified objects in the methods that are included in classes in all packages that start with com.sample, as the generation point.

Therefore, if lower packages (com.sample.abc or com.sample.abc.test) exist, those are also targeted.

com.sample.Main

This specifies generation of the user-specified objects in all the methods (including constructor and static initializer) that are included in com.sample.Main class, as the generation point.

com.sample.Main.main(java.lang.String[])

This specifies generation of the user-specified objects in the main(java.lang.String[]) method that is defined in the com.sample.Main class, as the generation point.

Tip
  • A single byte space (0x20) or tab (\t or 0x09) is the blank character that separates syntax elements.

  • One or more line feed characters (\n or 0x0A) or return characters (\r or 0x0D) continue at end-of-line.

  • Comments start with # and all characters in between # and end-of-line are considered as a comment.

  • * character in generation point indicates all classes existing in same or subpackages. Meaning of * in import declaration of Java language and * in generation point differs on the point that * in generation point targets classes in subpackages also.

(2) Example of coding the automatic placement configuration file

An example of coding the automatic placement configuration file is described below.

# comment
com.sample.*, java.util.ArrayList # comment
com.sample.Main.main(java.lang.String[]), java.util.LinkedList

This point describes contents of the coding example.

  1. All first lines are comments.

  2. Specify in such a way that the java.util.ArrayList object, generated by the class and method, which is included in all packages starting with com.sample. * is placed in the Explicit memory block. Text from # until end-of-line is considered as a comment.

  3. Specify in such a way that the java.util. LinkedList object generated by the com.sample.Main.main(java.lang.String[]) method is placed in the Explicit memory block.

    Reference note

    You can describe the entries that specify a class in JavaVM (for example, class in packages starting with java, javax), as a generation point for the user-specified object. However, specified entries might be treated as if they do not exist. If an entry is treated as if it does not exist, an error message is not output in the Explicit Management Heap log.

(3) Notes for the automatic placement configuration file

The following point describes the points to be considered when you specify the automatic placement configuration file.