Ticket #4320 (new defect)

Opened 7 years ago

Last modified 5 years ago

Memory Leak in Pyomo

Reported by: maxsax74@… Owned by: unassigned
Priority: major Milestone: Pyomo 4.x
Component: pyomo.core Version:
Keywords: pyomo memory leak Cc:

Description

Solving multiple time same AbstractProblem , memory grow indefinitely.

My analisys is based on simple code attached using an object profiler (objgraph.py); I attach also results of test on my machine (WinXP 32 bit + Python 2.7.2 + Coopr trunk 3.1.5454)

Leonardo

Attachments

src.zip Download (5.3 KB) - added by maxsax74@… 7 years ago.
source code for test
output.zip Download (15.6 KB) - added by maxsax74@… 7 years ago.
output of test

Change History

Changed 7 years ago by maxsax74@…

source code for test

Changed 7 years ago by maxsax74@…

output of test

comment:1 Changed 7 years ago by jdsiiro

#4321 closed as a duplicate of this ticket.

comment:2 Changed 7 years ago by jdsiiro

  • Milestone changed from Coopr 3.x to Coopr 3.2

OK - it looks like the leak stems from having problem writers (like the LP and NL writers) be plugins: after they write the problem, they are not being freed. Unfortunately, we still see a leak even when we use the direct interface. Here is what I am seeing:

  • with opt = SolverFactory("glpk"), we are leaking:
    • 3 dict
    • 1 list
    • 1 ExtensionPoint
    • 1 BoolOption
    • 1 !ProblemWriter_cpxlp
  • with opt = SolverFactory("cplex", solver_io="lp"), we are leaking:
    • same as glpk
  • with opt = SolverFactory("cplex", solver_io="nl"), we are leaking:
    • 6 dict
    • 2 list
    • 2 ExtensionPoint
    • 2 BoolOption
    • 1 !ProblemWriter_nl
    • 1 !ResultsReader_sol
  • with opt = SolverFactory("cplex", solver_io="python"), we are leaking:
    • 2 tuple

As a side note, in order to get reliable object counts, you need to add a forced gc.collect() in the loop immediately before running objgraph.show_most_common_types.

comment:3 Changed 6 years ago by jwatson

  • Milestone changed from Coopr 3.2 to Coopr 3.x

comment:4 Changed 5 years ago by wehart

  • Milestone changed from Coopr 3.x to Coopr 3.5

comment:5 Changed 5 years ago by wehart

  • Milestone changed from Coopr 3.5 to Coopr 3.x

I'm going to leave this active, but I believe that this issue has been resolved through the creation of the new plugin system in Coopr. So, we need to verify what we're leaking now.

Note: See TracTickets for help on using tickets.