Memory use dumps: Dmpsym

Top  Previous  Next

GAMS will report the number of cases stored for each item at the point in the program where the statement option dmpsym; is inserted.  The cases stored report is in the LST file and for the example (memdump.gms) looks like

 

SYMBOL TABLE DUMP, NR ENTRIES = 62

ENTRY  ID          TYPE  DIM  DIM-OK  LENGTH DEFINED ASSIGNED DATAKNOWN

 

    1  MAPVAL      FUNCT   0   False       0   False   False     False

    2  CEIL        FUNCT   0   False       0   False   False     False

    3  FLOOR       FUNCT   0   False       0   False   False     False

    4  ROUND       FUNCT   0   False       0   False   False     False

    5  MOD         FUNCT   0   False       0   False   False     False

....

   40  TIMECLOSE   FUNCT   0   False       0   False   False     False

   41  ERRORLEVEL  FUNCT   0   False       0   False   False     False

   42  HEAPSIZE    FUNCT   0   False       0   False   False     False

   43  ***         FUNCT   0   False       0   False   False     False

   44  SAMEAS      PRED    0   False       0   False   False     False

   45  DIAG        PRED    0   False       0   False   False     False

   46  FILE        FILE    0   False       0   False   False     False

   47  I           SET     1    True       5    True   False      True

   48  J           SET     1    True       5    True   False      True

   49  K           SET     1    True       5    True   False      True

   50  L           SET     1    True       5    True   False      True

   51  M           SET     1    True       5    True   False      True

   52  N           SET     1    True       5    True   False      True

   53  O           SET     1    True       5    True   False      True

   54  Y           PARAM   7    True   78125   False    True     False

   55  Q           PARAM   3    True     125   False    True     False

   56  X           VAR     7    True   78125   False    True     False

   57  F           VAR     3    True     125   False    True     False

   58  OBJ         VAR     0    True       0   False    True     False

   59  Z           EQU     7    True   78125   False    True     False

   60  RES         EQU     3    True     125   False    True     False

   61  OB          EQU     0    True       0   False    True     False

   62  MEMORY      MODEL   0    True       3    True    True      True

 

The dump has 2 parts

The first part contains information on GAMS functions that is of little user value.
The second part contains a report of number of cases stored for each item in the GAMS program.

So let's focus on the second part for the example memdump.gms.

 

SYMBOL TABLE DUMP, NR ENTRIES = 62

ENTRY  ID          TYPE  DIM  DIM-OK  LENGTH DEFINED ASSIGNED DATAKNOWN

 

    1  MAPVAL      FUNCT   0   False       0   False   False     False

....

   46  FILE        FILE    0   False       0   False   False     False

   47  I           SET     1    True       5    True   False      True

   48  J           SET     1    True       5    True   False      True

   49  K           SET     1    True       5    True   False      True

   50  L           SET     1    True       5    True   False      True

   51  M           SET     1    True       5    True   False      True

   52  N           SET     1    True       5    True   False      True

   53  O           SET     1    True       5    True   False      True

   54  Y           PARAM   7    True   78125   False    True     False

   55  Q           PARAM   3    True     125   False    True     False

   56  X           VAR     7    True   78125   False    True     False

   57  F           VAR     3    True     125   False    True     False

   58  OBJ         VAR     0    True       0   False    True     False

   59  Z           EQU     7    True   78125   False    True     False

   60  RES         EQU     3    True     125   False    True     False

   61  OB          EQU     0    True       0   False    True     False

   62  MEMORY      MODEL   0    True       3    True    True      True

 

In this dump, the columns of information that help in discovering large memory using items are

 

IDUser specified name for this item
TYPEItem type (set, parameter, variable etc.)
DIMNumber of indices used in item definition
LENGTHNumber of cases (related to memory use)

 

In this display the rows where there are high counts in the length are associated with the items within the GAMS program which have large numbers of internal cases that must be stored which is associated with memory requirements.  However, note that not all length counts are of equal significance.  In particular, variables and equations use more memory per element than parameters that use more per element than sets (variables and equations have memory use for bounds, levels, marginals and scales for each case while parameter items are just one number per case and sets can be just one yes no indicator).  In addition, note that set element explanatory text raises set element memory requirements.

Nevertheless one can look at the items (particularly variable, equations and parameters) that are of long length and make sure the number of cases stored are valid (reasons why it might not be are covered below).

Also note this dump gives status of active cases stored at the point in program where it is placed.