Why such Increase in used memory when using figures within a loop
古いコメントを表示
Hello,
I've a problem with increasing memory when using open figures within a loop. My application continously reads data from disk within a loop, processes the data and plots the results as stairs, plot and image within 5 different figures. The figures are opened when initializing the processing. The figure handles are saved and used with the command figure(handle1), .. figure(handle5) to plot the data after each processing step within the loop. Since a large amount of data will be processed and although I control the memory of the application (clear var1, var2, ...), the memory (seen in the Windows task manager) increases and increases and ... . After a while MATLAB crashes with Java errors after the application gets slower and slower and ... . If the amount of data is smaller, no crash occurs, but memory has been increased e.g. from 160MB to 400MB. After "close all", this goes down to less than 160 MB. After "clear all" memory increases to about 200 MB. It's a mystery to me. Is there anyone with similar problems? How to explain these effects and how to treat these? Any solution for this?
回答 (3 件)
Walter Roberson
2011 年 9 月 8 日
0 投票
You do not mention in the above description that you are delete()'ing the handle graphics objects. Clearing a variable that a handle is stored in does not delete the object.
But beyond that: there have been reports that would appear to be consistent with the possibility that there is a memory leak in the handle graphics system involving some interaction with Java. I do not recall reading that it has been officially proven yet.
Bernhard
2011 年 9 月 12 日
0 投票
1 件のコメント
Jan
2011 年 9 月 12 日
Please use comments to comment comments or answers, and not a new answer.
Insert the code in the original question by editing it, because it is not an "answer" to your problem.
See: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
カテゴリ
ヘルプ センター および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!