beginLockContentionStats

beginLockContentionStats(tableSize: Integer);

The beginLockContentionStats method of the System class 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 retrieve lock contention information using the getLockContentionStats method of the System class. The endLockContentionStats method of the System class is used to stop the recording of lock contentions.

The value of the tableSize parameter determines 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 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, an 1131 exception (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, but you should be aware that 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 lock contention recording is automatically ended.