uCosminexus Application Server, Expansion Guide
The objects stored in an HTTP session are the objects that are retained when the session is active. The objects exist from the generation of the session until the session is destroyed.
When you are not using the Explicit Memory Management functionality, many times, these objects are continued to be used during multiple executions of a copy garbage collection. Therefore, these objects are easy to rise to the Tenured area as long-life objects. Because objects that rise to the Tenured area are not recovered by a copy garbage collection, these objects are not recovered even after the session is destroyed. This leads to an increase in the memory usage of the Tenured area and a full garbage collection occurs.
The following figure shows an example of not using the Explicit Memory Management functionality
Figure 8-7 An example of not using the Explicit Memory Management functionality
When you generate a session in step 1, the area for storing objects is secured in the New area. In step 2, objects are stored in a session. After multiple executions of the copy garbage collection, the objects in step 1 and 2 move to the Tenured area. Although the session deactivates in step 3, objects in the Tenured area are not recovered and the memory usage goes on increasing.
You can inhibit the occurrence of the full garbage collection by changing the rise destination of objects related to the HTTP session from the Tenured area to the Explicit heap.
The following figure shows an example of using the Explicit Memory Management functionality
Figure 8-8 An example of using the Explicit Memory Management functionality
If you use the Explicit Memory Management functionality, the Tenured area does not increase due to the objects related to an HTTP session. Thus you can inhibit the occurrence of a full garbage collection. The J2EE server explicitly releases the Java objects placed in the Explicit heap after the session is destroyed.
This subsection describes the timing of securing and releasing the Explicit memory block area in which the HTTP session is to be placed.
The following table describes the mapping of an operation or an action executed by a Web application and a JavaVM action.
Table 8-4 Mapping of operations executed by Web application (API) and JavaVM action
| Operations (API) or actions executed by Web application | Web container action | JavaVM action |
|---|---|---|
|
Generating a session | Securing Explicit memory blocks |
|
Storing objects in the session | Placing objects in the Explicit memory block |
|
Destroying the session | Releasing Explicit memory blocks |
Apart from the HTTP session, the Web application + 2# Explicit memory blocks are used inside the Web container for objects for the HTTP session management.
#: Because two objects for management are kept internally in the Web container, add that count as well.
Note that you can reduce the memory size of the Explicit heap that is used in an HTTP session, by using the memory saving functionality of the Explicit heap. For details, see 8.11 Reducing memory usage of the Explicit heap that is used in an HTTP session.
If you implement an application by referring to Appendix A Efficiently using Explicit heaps to be used in HTTP session in the uCosminexus Application Server System Design Guide, you can efficiently apply the Explicit Memory Management functionality to a HTTP session.
All Rights Reserved. Copyright (C) 2013, 2015, Hitachi, Ltd.