question

Julio R avatar image
1 Like"
Julio R asked Ryan Clark commented

OpQuest stops whn RAM is full

I have a big model that uses a lot of memory but runs fine (altough slow) in FlexSim.

When I try to optimize the model it works fine but keeps using more and more RAM until it uses all my 40 MB, then the processor usage drops and then it stops incrementing the percentage of completion of the scenarios.

During this some scenarios are completed, but this does not decreases the % of used RAM as I would expect.

I tried it in computer that is the same model and it does the same thing but in a slower computer a it does not seem to do it. Can this be because of how the computer is set up?

Also this happens in both versions 2021 and 2022.

Is this normal? How can I try to correct it?

FlexSim 22.0.0
optimizationrammemory
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ryan Clark avatar image Ryan Clark commented ·

Hi @Julio R, was one of Jordan Johnson's or Joerg Vogel's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·
Jordan Johnson avatar image
1 Like"
Jordan Johnson answered

The RAM increasing in version 2021 makes sense. Results are stored in the tree. If you are generating lots of data for charts, or in tables, that data just keeps growing as you complete replications. So you need enough RAM to be able to store all the results, in addition to running all the replications.

In version 2022, we store results in a file, so things shouldn't keep growing and growing between scenarios. But running many simulations will still require lots of RAM. A small amount of growth may be expected; as you run more scenarios, the chart is showing more and more data, but that should be only a few MB more at most.

It looks like FlexSim crashes when this happens. If you re-open FlexSim, and look at the Experimenter's Run tab, can you see the optimizer results that were created before the crash? If so, you should be able to click the "run" button again. Any scenarios that have results in the database won't be simulated again, but the results still get reported to OptQuest, so you may be able to progress that way. Crashing is a bug, so it would be great to figure out the source of that bug, but you may be able to work around it for now.

I have some follow up questions:

  • Do you have any issues running a big experiment, rather than an optimization? Does your system RAM keep growing in that case as well? Do you get the error message you posted when talking to @Joerg Vogel?
  • I see you get an error message sometimes. Is that every time?
  • Does the memory increase in the main process, or in each of the child processes?
  • Have you tried it with the "Restore original state between replications" box checked and unchecked? Is there a difference between those?
  • Is the memory increasing in the main FlexSim process, or in the child processes, or both?
  • Is there any way you could share the model with the dev team? If there is an issue, it would helpful if we could re-produce it.
  • After the issue happens, can you re-open the model, and click the View Results button on the Experimenter? If so, and if it looks like you have results, can you see any system console messages on the Console Output tab?
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Julio R commented

Restrict number of processor cores used while optimization in experimenter

It is a feature of advanced tab.

https://docs.flexsim.com/en/22.0/Reference/Tools/Experimenter/#advanced

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Julio R avatar image Julio R commented ·

Thank you for the sugestion @Joerg Vogel ,

I did that and I got further into the optimization, but memory still was almost full the more scenarios it did, then I got this error:

optimizer-error.jpeg

Do you think this releated to the same issue?

I have been reading on some cases of memory leaks like this question,

Potential memory leak on Reset - FlexSim Community

Do you think this may be releated?

1 Like 1 ·
optimizer-error.jpeg (114.2 KiB)
Joerg Vogel avatar image Joerg Vogel Julio R commented ·

Good to know it now. If you mentioned it in your question, I wouldn’t have suggested a standard reply. Instead I would have thumbed it up right away as an important question. It is a good a habit to describe what answers you found and what did to get around your problem. Good luck to get answers from development fast! Joerg

1 Like 1 ·
Julio R avatar image Julio R Joerg Vogel commented ·

Thank you @Joerg Vogel,

I actually found that question after doing a test with your suggestion, so your help was very helpful. I´m not even sure if they are related, let´s see what development has to say.

2 Likes 2 ·