uitable run in loop causes java out of memory and crashes

조회 수: 3 (최근 30일)
Daphne
Daphne 2013년 9월 10일
댓글: John Anderson 2013년 11월 25일
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