uCosminexus Application Server, Expansion Guide

[Contents][Index][Back][Next]

2.9.2 Flow of garbage collection control processing

The garbage collection control is processed with the following procedure.

Figure 2-15 Flow of garbage collection control processing

[Figure]

  1. Monitoring memory
    Monitoring timer thread monitors memory of JavaVM. If conditions described in step (1) are fulfilled, a garbage collection execution request is sent to the garbage collection control functionality.
  2. Checking resource exclusion
    When a garbage collection execution request is sent, the garbage collection control functionality examines whether resources are in exclusion.
  3. Waiting for execution of full garbage collection
    If resources are under exclusion, the execution of full garbage collection is put on standby.
  4. Executing full garbage collection
    When resource exclusion is released, a full garbage collection is executed.

The following subsections describe each process:

Organization of this subsection
(1) Monitoring memory
(2) Checking resource exclusion
(3) Waiting for the execution of the full garbage collection
(4) Executing full garbage collection
(5) Notes

(1) Monitoring memory

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:

(2) Checking resource exclusion

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
  • When executing java.sql.Statement#execute
  • When executing java.sql.Statement#executeUpdate
  • When executing java.sql.Statement#executeQuery
  • When executing java.sql.Statement#executeBatch
Y N
Performing operations for ResultSet
  • When executing java.sql.ResultSet#deleteRow
  • When executing java.sql.ResultSet#insertRow
  • When executing java.sql.ResultSet#updateRow
Y N
Performing operation such as object acquisition#1
  • When executing java.sql.Statement#addBatch
  • When executing java.sql.Connection#prepareCall
  • When executing java.sql.Connection#prepareStatement
Y N
During transaction
  • When executing transaction with Connection API#2
  • When executing local transaction (JTA)#2.
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.

(3) Waiting for the execution of the full garbage collection

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

[Figure]

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.

(4) Executing full garbage collection

If there is no resource exclusion, a full garbage collection is executed.

(5) Notes