Will I receive "Out of Memory" error eventually: Both the "Memory available for all arrays" and "Memory used by Matlab" increase

1 次查看(过去 30 天)
Hi, I have a Matlab program that need to run for months continuously. I keep monitoring the memory usage by using "memory" command periodically. What I observed is that both the "Memory available for all arrays" and "Memory used by Matlab" increase over time. For about half a day. "Memory available for all arrays" increases by 48MB, while "Memory used by Matlab" increases by 31MB. I do have a task that runs periodically at high rate, with a call to a mex function. But there is no memory allocation during runtime. Will my program crash with "Out of memory" error eventually? Which memory in memory command is the actual limit that cause the "Out of memory" error?

采纳的回答

Guillaume
Guillaume 2017-4-13
Well, if both the memory available and the memory used keep on increasing with the available increasing faster than that used, then you're safe since on balance there's more memory available for matlab. Of course, if the memory available for all arrays increases while the memory used by matlab also increases that means that some other program is using less memory. So, at some point that other program will settle down to its minimum usage and then the increased usage by matlab may be become a problem.
Whether or not you'll run out of memory depends on how much memory you have, how long you want to run for and what the rate of memory increase is. You'll get a out of memory error if:
  • memory available for all arrays decreases to 0
  • you try to increase the size of an existing array (e.g. by adding elements) so that its memory requirement are higher than maximum possible array size.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by