What does it mean when a task has the content 'SPACE' for 'First ECB' in Perfmon reports?
search cancel

What does it mean when a task has the content 'SPACE' for 'First ECB' in Perfmon reports?

book

Article ID: 58204

calendar_today

Updated On:

Products

IDMS IDMS - Database IDMS - ADS

Issue/Introduction

Description:

Perfmon Realtime Monitor PMRM Active User Task Detail may show a value of 'SPACE' as an ECB in the list of ECBs on which the task may be waiting. This document explains what that means and how to reduce the frequency with which they occur.

Solution:

The value of SPACE in the FIRST ECB column of Perfmon reports indicates that we are waiting on a Page Space lock. The Page Space lock is a type of lock in IDMS which controls the ability of the transaction to update the 'space available' value for the page. Whenever a transaction does an update that will alter the Space available on a database page (STORE, ERASE, or a MODIFY that changes the length of a variable-length record), the first thing that program will do is to acquire an EXCL lock on the "Page Space" for the page where the record resides. Most locks are held until the transaction issues a COMMIT or a RELEASE, but this 'SPACE' lock will be released as soon as the update operation is complete.

For a transaction that will alter the available space on the page, the sequence of locks is this:

  1. First we obtain an EXCL lock on the 'PAGE SPACE';
  2. We obtain a lock on the record to be updated (if it is a STORE, ERASE or MODIFY);
  3. We obtain a lock on any other records which need to be updated. This may be owner records, other records in the set, etc - any records whose pointers need to be updated as a result of the update to the target record.
  4. When the update operation is complete, we release the SPACE lock.
  5. When the transaction issues a COMMIT, FINISH, or ROLLBACK, we release all the other EXCL locks.

Sometimes, in the process of trying to obtain the lock we want in the first step noted above, we can't get the Page Space lock we want because another transaction is already holding an exclusive lock on it. In that case we have to wait until the lock can be obtained, or until we abend with a deadlock, or until we reach a timeout as specified for the task. While we are in such a state of waiting for the Page Space lock, the FIRST ECB column will have a value of SPACE.

The way to reduce the number of SPACE locks that you see, then, is to allow the update transactions to complete more quickly. This is done by reducing the contention / competition for locks, so that we can get the locks for the update operation when we first try to do so. That in turn is achieved by holding locks for the shortest amount of time necessary. That means that applications should be modified to issue COMMIT, FINISH, or ROLLBACK commands often, or as frequently as possible. There may also be some changes to the database (fewer records per page, etc) which would reduce the competition for certain types of locks. More specific recommendations would require more details about the applications involved.

Environment

Release: All Supported Releases
Component: IDMS Perfmon Realtime Monitor PMRM

Resolution

.