Crash Upon Adding New Variable, Possible Memory Issue
Posted: Fri Mar 15, 2019 1:51 am
Hello Ventana Systems folks,
As you know, we have a mature and sophisticated Vensim model, the Energy Policy Simulator. Most of the variables in the model are subscripted in various ways. For example, some existing variables use the following three subscripts:
When I add a new variable to the model that is subscripted by these same three subscripts, and I try to run the model, Vensim crashes (unexpectedly quits). This happens every time with perfect reproducibility. It doesn't matter what data is in the new variable. The equation can simply consist of the number zero, and it will still crash.
I am worried that perhaps we are running into some limit in Vensim on how many variables or fields can be addressed in memory. But my computer's RAM isn't the issue. When I load the Energy Policy Simulator in Vensim and check Vensim's memory use in Task Manager, it is using only 5.5 MB:
When Vensim has crashed, the memory use jumps to 38.6 MB, which is a lot more than before, but is still a tiny fraction of my system's available memory:
I've tested this in Vensim DSS v7.1 (32-bit) and Vensim DSS v7.3.5 (32-bit), and the crash happens in both cases. I don't have a 64-bit version of Vensim to test with.
If you want to test this bug yourself, simply download a copy of the Energy Policy Simulator (eps-1.4.2-us-v2) from https://us.energypolicy.solutions/eps-a ... -us-v2.zip
First, open it in Vensim DSS and click "Simulate." It should run without an error (though you may see initial value warnings).
Then, add a variable to the model like the following:
Click "Simulate," and the model will crash.
Note that the model runs if the new "Test Variable" uses any two of the three subscripts above. It only causes a crash if the Test Variable uses all three subscripts.
If you want to see an example of an existing variable that uses these three subscripts, you can look at any of these:
The existence of these variables shows that Vensim can handle variables using these three subscripts in this model without crashing. It is only the addition of one more variable with these three subscripts that causes it to crash.
Do you know why we can't add another variable to the model using these subscripts without causing it to crash? What options do we have, if we want to continue adding variables to this model without causing it to crash?
As you know, we have a mature and sophisticated Vensim model, the Energy Policy Simulator. Most of the variables in the model are subscripted in various ways. For example, some existing variables use the following three subscripts:
Code: Select all
[Industry Category, Industry Process Emissions Policy, Marginal Abatement Cost]
I am worried that perhaps we are running into some limit in Vensim on how many variables or fields can be addressed in memory. But my computer's RAM isn't the issue. When I load the Energy Policy Simulator in Vensim and check Vensim's memory use in Task Manager, it is using only 5.5 MB:
When Vensim has crashed, the memory use jumps to 38.6 MB, which is a lot more than before, but is still a tiny fraction of my system's available memory:
I've tested this in Vensim DSS v7.1 (32-bit) and Vensim DSS v7.3.5 (32-bit), and the crash happens in both cases. I don't have a 64-bit version of Vensim to test with.
If you want to test this bug yourself, simply download a copy of the Energy Policy Simulator (eps-1.4.2-us-v2) from https://us.energypolicy.solutions/eps-a ... -us-v2.zip
First, open it in Vensim DSS and click "Simulate." It should run without an error (though you may see initial value warnings).
Then, add a variable to the model like the following:
Code: Select all
Test Variable[Industry Category,Industry Process Emissions Policy,Marginal Abatement Cost]=
0
~ Dmnl
~ |
Note that the model runs if the new "Test Variable" uses any two of the three subscripts above. It only causes a crash if the Test Variable uses all three subscripts.
If you want to see an example of an existing variable that uses these three subscripts, you can look at any of these:
Code: Select all
PERAC Mass CO2e Avoidable by Marginal Cost
Reduction in Process CO2e Left to Assign after this Marginal Cost
Reduction Achieved by Marginal Cost
Do you know why we can't add another variable to the model using these subscripts without causing it to crash? What options do we have, if we want to continue adding variables to this model without causing it to crash?