Skip to main content

RAM overload when setting the constraints

Awaiting user input

Comments

3 comments

  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    Hi Nikola,

    If I understand correctly, out-of-memory occurs when model building. Then, using the Gurobi cloud will not help.
    I think there is no other way than trying to identify what exactly causes the large memory consumption. 
    Several thousand constraints do not sound huge. What is the exact number of variables and constraints?
    You could use a memory-profiler to analyze which lines in your code cause the issue and share them.
    Best regards,
    Marika

    0
  • Nikola Grlj
    First Comment
    First Question

    Hi Marika, use of RAM is progressively growing as the constraints are being set. I can see that there are 941738 variables and two sets of constraints; 4042 and 3462. So setting first set of constraints of 4042 will eat up all 12GB of RAM. This is the case when I run my problem in Google Colab. When I run it on my local machine, RAM is not the issue as both sets of constraints are set in a reasonable time (each one takes about 20-30 minutes). After that, solving does not start, instead no output is created and after a while Python issues a kill signal and program is stopped. Unfortunately the issue with memory-profile is that it suffocates execution of the code by prolonging time of constraint setting process to 15 hours or so per set. So in short, when running code on Colab, RAM is eaten up when setting first set of constraints. When running code locally, both sets of constraints are solved and code breaks when presolving is supposed to start.

    0
  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    How many variables have a non-zero coefficient in one constraint (on average)?
    Could you reduce the problem so that you can write an MPS file? Then, compare the memory consumption when building the (reduced) model within your API to the memory consumption when reading the MPS file with Gurobi. Are both similar in size?

    0

Please sign in to leave a comment.