If you use Gurobi Compute Server or a shared license via the token server, you may need to release the Gurobi environment. The steps vary by programming language:
- C: Call GRBfreemodel() for each model, then call GRBfreeenv() for the Gurobi environment
- C++: If you use pointers to GRBModel and GRBEnv objects, delete all GRBModel objects, then delete the GRBEnv object
- .Java: Call GRBModel.dispose() on all GRBModel objects, then call GRBEnv.dispose() on the GRBEnv object
- .NET: Call GRBModel.Dispose() on all GRBModel objects, then call GRBEnv.Dispose() on the GRBEnv object
- Gurobi 9.0.0 or newer: Call Model.dispose() on all Model objects, Env.dispose() on all Env objects (if used), then call disposeDefaultEnv(). More details.
- Gurobi 8.1.1 or older: Delete all Model objects, delete all Env objects (if used), then call disposeDefaultEnv()
If you forget to do this, the solver may be temporarily unavailable for other programs.