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