Consultor Eletrônico



Kbase P57762: Save Cache option causes 6495 error
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/14/2008
Status: Verified

SYMPTOM(s):

Save Cache statement core dumps in multi user mode.

Out of free shared memory. Use -Mxs to increase. (6495)

SYSTEM ERROR: mtlatch <latch-num>, holding <lock>. (3712)

SYSTEM ERROR: mtlatch 2, holding 0xa0. (3712)

Save cache will work in single user mode.

Save Cache option causes 6495 error

Database crashes with error 6495.

Using mandatory fields.

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.1D
Progress 9.1E
OpenEdge 10.x

CAUSE:

Bug# OE00115915

CAUSE:

Mandatory Fields are not part of the calculation for shared memory allocation. The 4GL statement, SAVE CACHE, causes the database manager to dynamically read all mandatory fields into shared memory. The database manager can experience a situation where it is unable to read the mandatory fields into shared memory because of insufficient shared memory space. This is because the number and size of mandatory fields for the database were not considered during the initial shared memory allocation on startup of the database broker.

If the database has many mandatory fields and the -Mxs argument is not specified, it is possible that all shared memory will be consumed when the manadtory field array is built causing a database crash. Any time a client needs mandatory field information it requests the information from the RDBMS. If the manadatory field information for the table in question is not in the shared memory cache the manadatory field list is dynamically added to the cache. The shared memory must be allocated at this time. If there is not enough shared memory available the database crashes.

FIX:

If the database contains mandatory fields the amount of extra shared memory that should be specified when the database is started must be calculated. The approximate memory requirements when using manadtory fields is as follows:
480 bytes overhead
48 bytes for each table that contains manadatory field(s)
8 bytes for each mandatory field
These numbers are approximations and have been rounded up to account for the 32 bit and 64 bit datatype sizing differences. In addition, the sizes may change from release to release. The total number of bytes calculated must be added to the existing default -Mxs.

Use the following 4GL program to determine the number of mandatory fields & the amount to increase -Mxs. This program will calculate the amount of shared memory that should be reserved based on the number of mandatory fields in the database. The total memory required takes into account a database that is started with a -n (number of users) of 100 or less. If more than 100 users are required, the numusers program variable should be initialized appropiately.

DEFINE VAR mem AS INTEGER INIT 0 NO-UNDO.
DEFINE VARIABLE man-file-count AS INTEGER INIT 0 NO-UNDO.
DEFINE VARIABLE man-field-count AS INTEGER INIT 0 NO-UNDO.
DEFINE VARIABLE mxs100 AS INTEGER NO-UNDO.
mxs100 = (16 * 1024) + (100 * 400).
mem = 480.
/*
Process each mandatory field in the _field table. When _file-recid
changes, add in the memory requirements for an additional table. Add
the memory requirements for each field.
*/
FOR EACH _field where _mandatory = yes BREAK BY _file-recid.
IF FIRST-OF(_file-recid) THEN DO.
mem = mem + 48.
man-file-count = man-file-count + 1.
END.
man-field-count = man-field-count + 1.
mem = mem + 8.
END.
DISPLAY "Mandatory tables" man-file-count WITH NO-LABELS 2 col FRAME a.
DISPLAY "Mandatory fields" man-field-count WITH FRAME a.
DISPLAY "Mandatory field array memory required" mem WITH FRAME a.
DISPLAY "Default -Mxs for 100 users " mxs100 WITH FRAME a.
DISPLAY "Total memory required including default -Mxs" (mem + mxs100) WITH FRAME a.
display "-Mxs value including mandatory field array" int(((mem + mxs100) / 1024)) + 1 with frame a.