Product Information > JADE Object Manager Guide > Chapter 4 - JADE System Instrumentation and Diagnosis > SystembeginLockContentionStats Method

System::beginLockContentionStats Method

beginLockContentionStats(tableSize: Integer);

The System class beginLockContentionStats method starts recording lock contentions for persistent objects. A lock contention occurs when an attempt to lock a persistent object is queued because the object is already locked.

After recording has been initiated, you can call the getLockContentionStats method to retrieve lock contention information. Call the endLockContentionStats method to stop the recording of lock contentions.

The tableSize parameter enables you to specify the maximum number of individual contended objects that can be recorded. When the first contention for an object is noted, the object is added to the table of contentions, provided that the maximum table size has not been reached. If the table has reached the maximum size, contentions for objects not found in the table are grouped together in a single entry identified by a null object identifier; that is, the class number and instance number are both set to zero (0).

As a guideline, the size of each entry is approximately 40 bytes, so 25,000 entries would consume approximately 1M byte of memory.

Only one process at a time can control the recording of lock contentions. If a process executes the beginLockContentionStats method when recording of lock contentions has already been initiated by another process, exception 1131 (Another process is currently in control of lock contention statistics) is raised. However, processes other than the one that initiated lock contention recording can retrieve lock contention information, although the information may be cleared or become unavailable at any time.

If the process that started to record lock contentions terminates without having called the endLockContentionStats method to stop lock contention recording, the recording of lock contentions is automatically ended.