Try our new documentation site (beta).


MemLimit

Memory limit
 Type: double
 Default value: Infinity
 Minimum value: 0
 Maximum value: Infinity

Limits the total amount of memory (in GB, i.e., <span>$</span>10^9<span>$</span> bytes) available to Gurobi. If more is needed, Gurobi will fail with an OUT_OF_MEMORY error (see the Error Code section for further details).

Note that it is not possible to retrieve solution information after an error termination. Thus, the behavior of this parameter is different from that of other termination criteria like SoftMemLimit, TimeLimit, or NodeLimit, where the solver will terminate with a Status Code and solution information will still be available.

One advantage of using this parameter rather than the similar SoftMemLimit is that MemLimit is checked after every memory allocation, so Gurobi will terminate at precisely the point where the limit is exceeded.

Note that allocated memory is tracked across all models within a Gurobi environment. If you create multiple models in one environment, these additional models will count towards overall memory consumption.

Memory usage is also tracked across all threads. One consequence of this is that termination may be non-deterministic for multi-threaded runs.

For examples of how to query or modify parameter values from our different APIs, refer to our Parameter Examples.

Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Academic License
Gurobi supports the teaching and use of optimization within academic institutions. We offer free, full-featured copies of Gurobi for use in class, and for research.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.

Search

Gurobi Optimization