Hitachi

uCosminexus Application Server Expansion Guide


7.6.3 Directly generating objects in the Explicit memory block

This section describes how to directly generate objects in the Explicit memory block and the processes that are executed.

In an application, if you want to generate objects in the Explicit memory block, use the API described in (1) Execution timing. When you execute the API, an object of the class that you specified in the argument, is generated in the Explicit memory block. However, objects that are generated in the initialization process by the constructor of that object are generated in the Java heap.

Organization of this subsection

(1) Execution timing

If you use the Explicit Memory Management functionality in your application, you can directly generate an object in the Explicit memory block by invoking one of the following Explicit Memory Management functionality APIs.

Besides these API, an object is also directly generated in the Explicit memory block when the object that you specified in the automatic placement configuration file of Explicit Management Heap is generated and the Explicit memory block is initialized.

You need not be aware of the objects placed by the J2EE server.

(2) Executed details

This subsection describes the details executed for each API.

Table 7‒5: Details executed for each API

API

Executed details

ExplicitMemory.newInstance(Class type)

This API instantiates the class that you specify in type argument and places that class in the Explicit memory block shown by receiver.

ExplicitMemory.newInstance(Class type, Object... args)

ExplicitMemory.newInstance(java.lang.reflect.Constructor cons, Object... args)

This API instantiates the class shown by java.lang.reflect.Constructor and places it in the Explicit memory block shown by receiver.

ExplicitMemory.newArray(Class type, int number)

This API instantiates the array of classes that you specify in type argument, of the length that you specify in number argument and places it in the Explicit memory block shown by receiver.

ExplicitMemory.newArray(Class type, int[] dimensions)

This API instantiates the array of classes that you specify in type argument, of the number of dimensions that you specify in dimensions argument and places it in the Explicit memory block shown by receiver.

For details on APIs, see 10.3 ExplicitMemory class in the uCosminexus Application Server API Reference Guide.

However, if you cannot secure the required area in the Explicit memory block at the placement destination, the generated objects are not placed in the Explicit memory block. The generated objects are placed in the Java heap.

For the reasons why the area cannot be secured and the executed processes, see the description of why the extension process cannot be executed in 7.6.4 Extending the Explicit memory block.