Profiling to find memory hogging statements

Top  Previous  Next

Now lets look at what the profile is revealing about memory.gms.  The inserted blue lines indicate execution stage and are not generated by GAMS.

 

----      3           OTHER          0.000     0.000 SECS    1.6 Mb

----      5           OTHER          0.000     0.000 SECS    1.6 Mb

----      6           OTHER          0.000     0.000 SECS    1.6 Mb

----     22 ASSIGNMENT y             0.050     0.050 SECS    3.7 Mb  78125

----     23 ASSIGNMENT x             0.060     0.110 SECS    8.4 Mb  78125

----     24 ASSIGNMENT x             0.030     0.140 SECS    8.4 Mb  78125

----     25 ASSIGNMENT q             0.000     0.140 SECS    8.4 Mb    125

----     34           OTHER          0.000     0.140 SECS    8.4 Mb

generate

----     35 SOLVE INIT memory        0.000     0.140 SECS    8.4 Mb

----     29 EQUATION   z             0.460     0.600 SECS   27.8 Mb  78125

----     31 EQUATION   res           0.000     0.600 SECS   27.8 Mb    125

----     27 EQUATION   ob            0.341     0.941 SECS   29.9 Mb      1

----     35 SOLVE FINI memory        0.340     1.281 SECS   29.9 Mb

----     35 GAMS FINI                1.032     2.313 SECS   29.9 Mb

----      1           EXEC-INIT      0.000     0.000 SECS   11.3 Mb

Solve

----     35 SOLVE READ memory        0.130     0.130 SECS   16.0 Mb

 

Note the red lines show where memory use jumps are encountered (i.e., statements 22, 23 and 29.  In turn, one can examine those statements to see if they can be reworked for memory use reduction.