Skip to content

Memory management with exported model run #97

Answered by fumitoh
bakerwy asked this question in Q&A
Discussion options

You must be logged in to vote

You can discard cached results when you no longer need them by deleting the model. Note that you can create as many instances of the exported model as you want.

Suppose you create an exported model using the code below.

import modelx as mx

mx.read_model('lifelib/libraries/savings/CashValue_SE').export('CashValue_SE_nomx')

The code above creates the CashValue_SE_nomx package in the current directory.

The exported model is an instance of the _c_CashValue_SE class defined in CashValue_SE_nomx._mx_model.

When importing CashValue_SE_nomx, one instance is created. This instance is named mx_model and also CashValue_SE in both CashValue_SE_nomx._mx_model and CashValue_SE_nomx. These four names r…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bakerwy
Comment options

Answer selected by bakerwy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants