Memory usage accumulation in CBC solver with python-mip wrapper #603
Replies: 2 comments 1 reply
-
I don't see anything in your code sample that would track the memory usage - how are you measuring that? Is this running in pypy or cpython?
I let your example code run. Its 20 iterations in and so far the process memory usage according to Windows Task Manager is a consistently between 120 and 140MB. |
Beta Was this translation helpful? Give feedback.
-
I had the same issue, and posted my workaround in the Hope it helps! |
Beta Was this translation helpful? Give feedback.
-
The code below solves an IP relating to an$n\times n$ chessboard using CBC solver with
python-mip
wrapper (version 1.15.0). It solves the problem repeatedly with a time limit of 60 seconds. Within the given time limit, the program only produces a feasible solution. The IP itself does not matter, it only illustrates my question in the end.During the execution on my laptop (Ubuntu 22.04LTS), I notice that the memory usage slowly increases after each iteration. Below are the statistics
Intuitively, the program's memory usage should be reset to 0 after each iteration (since the
model
variable is re-created). I've trieddel model
at the end of the iteration, but it does not resolve the problem.I wonder what is the cause of the accumulation. Right now, I suspect that the search tree stored in CBC solver still exists even after it reaches the time limit.
My questions:
python-mip
wrapper?python-mip
?Side note. This question has been asked on stackoverflow, but it has received no answer until now.
Beta Was this translation helpful? Give feedback.
All reactions