uitable run in loop causes java out of memory and crashes

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

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일

0 개 추천

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

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).
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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Call Java from MATLAB에 대해 자세히 알아보기

질문:

2013년 9월 10일

댓글:

2013년 11월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by