uCosminexus Application Server, Expansion Guide
The garbage collection control is processed with the following procedure.
Figure 2-15 Flow of garbage collection control processing
The following subsections describe each process:
The monitoring timer thread monitors JavaVM memory and sends a garbage collection execution request to garbage collection control functionality, if any of the following conditions are fulfilled:
When a garbage collection execution request is generated, the garbage collection control functionality checks connections used by the batch application. When checking the connections, the functionality confirms whether the batch application is performing resource exclusion.
The following table describes states considered as the resources are in exclusion.
Table 2-28 States considered as resource is under exclusion
| Transaction | State | DB Connector | JDBC | |
|---|---|---|---|---|
| Out of transaction | Executing SQL statement#1 |
|
Y | N |
| Performing operations for ResultSet |
|
Y | N | |
| Performing operation such as object acquisition#1 |
|
Y | N | |
| During transaction |
|
Y | N | |
| When executing global transaction (JTA) | -- | -- | ||
Legend: Y: Handled as resource under exclusion
N: Handled as resource not under exclusion
--: Not applicable
#1: java.sql.Statement in the table -includes sub-interfaces java.sql.PreparedStatement and java.sql.CallableStatement.
#2: Shows a status after starting a transaction (after executing setAutoCommit(false) or UserTransaction.begin), in which execution of SQL statement or operation for ResultSet is performed one or more times, and transaction conclusion processing is not complete.
Resource operations performed by using JDBC are handled as no resource exclusion. For example, if you execute a program in which execution of JDBC SQL statements and transaction processing on DB Connector are mixed, only the transaction processing on DB Connector is targeted for the garbage collection control functionality.
If it is determined that resources are in exclusion, the KDJE55024-I message is output and the state is waiting for execution of a full garbage collection. The full garbage collection continues to be in standby state even if there is single resource exclusion. The following figure shows an example of waiting for execution of the full garbage collection.
Figure 2-16 Example of waiting for execution of the full garbage collection
In this figure, two resources are accessed in a single job program. If execution of a full garbage collection is requested during resource exclusion, the garbage collection control functionality sets execution of the full garbage collection to standby state. When con2.commit() that ends the access of two resources is executed, the exclusion is removed.
If there is no resource exclusion, a full garbage collection is executed.
All Rights Reserved. Copyright (C) 2013, 2015, Hitachi, Ltd.