uitable run in loop causes java out of memory and crashes

5 次查看(过去 30 天)
I am generating figures in a loop, including plots and a uitable (30x13). Using MATLAB 2012b and a Win 7 64bit PC with 8GB RAM. I have added pauses before the uitable and that brought me up to 200 loops possible, but still crashes. Running more figures results in several lines of error (java & memory related). I cannot copy the errors, as the matlab usually hangs then and just closes...
Any ideas?
  1 个评论
John Anderson
John Anderson 2013-11-25
I am having a similar problem. I am publishing a file that generates a large number of figures containing uitables although only displaying one at a time. I experience a java memory error (java.lang.OutOfMemoryError: Java heap space) and Matlab hangs or becomes sluggish. I have taken a look at the amount of free memory avilable between figures via a call to java.lang.Runtime.getRuntime.freeMemory and this tends to decrease over time, even though the figures are being deleted once their contents have been published. I guess this reflects an underlying memory management issue relating to uitable as this doesn't occur with other uicontrols. I'd be interested to hear any progress on resolving this issue.
John

请先登录,再进行评论。

回答(1 个)

Jan
Jan 2013-9-10
Do you create 200 figures in a loop and leave them all open? If so, why? No human can navigate in a pile of 200 windows.
Increasing the Java Heap Space might be useful, but I assume it is much better to find a solution, which creates less figures, e.g. by re-using existing figures and uitables and updating the contents only.
  2 个评论
Daphne
Daphne 2013-9-10
Sorry, I didn't mention that. No, I do not generate that many figures. I open a figure, get everything on it, save it as PDF, then close it (thought close may be better than just clf).
Jan
Jan 2013-9-10
Re-using an existing figure saves a lot of resources, and after a lot of Java related problems, re-using the uitable might be even more important.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 App Building 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by