Skip to main content

'Python has stopped working' after called Gurobi to solve hundreds of large size MILP

Answered

Comments

5 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Sonja Mars
    • Gurobi Staff Gurobi Staff

    Hi Larry,

    Are you generating these instances all at the same time (in parallel) or one after another?

    • If the first is the case you need a machine with lots of RAM. Disk space is not really interesting here.
    • If the second is the case and you don't need the models anymore you should make sure to delete them. It is possible that the automatic garbage collector of Python has not yet freed the memory and you are simply running out of memory.

    Best regards,

      Sonja

    0
  • Bo Lan
    • Gurobi-versary
    • First Comment
    • First Question

    Sonja,

    Thank you for your reply.

    I generated instances in series, i.e. generated one and solved it then generated and solved the next one. It means at anytime there's only one instance being processed.

    Every time when I use

    model = grb.Model()

    to generate  a new model I think the old one should have been deleted. Is that correct? Or is there any  simple code to delete the old model completely?

    Thanks,

    Larry

    0
  • Sonja Mars
    • Gurobi Staff Gurobi Staff

    Hi,

    If you do it that way they should get deleted. However, you can also force a model model to be garbage collected with the statement

    del model

    Best regards,

    Sonja

     

    0
  • Bo Lan
    • Gurobi-versary
    • First Comment
    • First Question

    Thank you, Sonja. That's easy and helpful.

    Larry

    0

Post is closed for comments.