Forum Discussion
FICO
2 years agoCommunity Manager
Xpress Optimizer Memory Issue and Configuration
Hi, We are using FICO Xpress optimizer version 8.12.3 in dot net C#. So we are using the BCL library along with the optimizer library. We are containerizing the dot net service in a Linux container...
FICO
2 years agoCommunity Manager
Hi @Daniel Junglas ,
Thank you for the reply. I want to confirm if we are disposing of all Xpress entities correctly.
In our algorithm, we are solving multiple MIP models iteratively. For each step following is the way we use Xpress.
- We have an object XpressSolver which implements IDisposable.
- We initialize the OEM license in the constructor that does
- XPRB.init() and XPRS.License()
- Using XpressSolver we create an object called XpressModel like below
using (XPRBexprContext ctx = new XPRBexprContext())
{
var bclProblem = new XPRBprob(problemName);
var optimizerProblem = bclProblem.getXPRSprob();
return new XpressModel(problemName, bclProblem, optimizerProblem, new XpressParameterData(optimizerProblem), this.logger);
}- Xpress model is also Disposable.
- We solve the model (creating variables, expressions, constraints etc.)
- Once the model is done we dispose bclProblem and optimizerProblem.
- Then we dispose the XpressSolver to release the license by calling
- XPRB.free()
Based on your answer It seems we are not using XPRBexprContext correctly. I believe we should create that object and keep it in the model and dispose of it when the model is done.
Please let me know if that understanding is correct. Also, do we need to dispose of any other Xpress objects like variables or constraints, etc.?
Best,
Shamsher

