Possible memory leak in Gurobi C++ API
Awaiting user inputI have a function, say func(). In func(), I create a GRB model with the code below:
GRBModel m = GRBModel(*env);
Variable m takes about 5 MB after I call m.optimize(). Ideally, when func() is finished, all variables created on the stack will be destroyed, including variable m. However, it seems the 5MB memory used by variable m is not released. To be clear, I have already manually freed objects returned by Gurobi methods during the modeling process, e.g., new variable array returned by GRBModel::addVars.
As I have to call func() up to 10 thousand times in my program, memory drains very quickly. I'm thinking if it is possible that we have memory leak issue on GRBModel class. Any comments are appreciated.
-
Official comment
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?. -
Hi,
Could you post a minimal working example reproducing this issue?
Best regards,
Jaromił0
Post is closed for comments.
Comments
2 comments