Insufficient Java heap memory to continue operation

조회 수: 3 (최근 30일)
Franziska Wegner
Franziska Wegner 2013년 9월 11일
답변: Ikki kishida 2015년 5월 1일
Dear Community,
I get the following error message again and again after running some saveas(gcf, 'test' , 'pdf'); or print figures.
Insufficient Java heap memory to continue operation
No close all, close gcf, clear all or any tool to clean the java heap http://www.mathworks.com/matlabcentral/fileexchange/36757-java-heap-cleaner helps. I send multiple error report from Matlab directly, but get no response. Last error message I got was:
Error using drawnow
Insufficient Java heap memory to continue operation
Error in prepare (line 44)
drawnow
Error in print>LocalPrint (line 271)
pj = prepare( pj, h );
Error in print (line 240)
LocalPrint(pj);
Error in saveas (line 154)
print( h, name, ['-d' dev{i}] )
Error in myClass/myMethod (line 45)
saveas(gcf, 'test', 'pdf');
If I restart Matlab it works for a couple of runs and then it crashes again. After each run I make a clear all and close all, but both commands does not help. In addition, I put the heap option to the maximum.
Thank you for your help in advance.
Best regards!
  댓글 수: 1
laurie
laurie 2013년 9월 11일
i get this from time to time as well when working with pictures or such. appart from : - running your code on a bigger computer, - restarting Matlab between each run, and - trying to make your code more "memory-friendly" (for example one a picture is saved and you don't need it any more, clean it in your code to save memory ressources) i can't help you much... it just sucks ! sorry

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

답변 (1개)

Ikki kishida
Ikki kishida 2015년 5월 1일
I got the same error and reached at here. In my case, if I made a figure invisible, the error was't generated.
fig=figure('visible','off');
plot(...);
saveas(fig,'test','png');
close;
I hope it's gonna work for you.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by