How to avoid Java Heap OutOfMemoryError Exception?
6 次查看(过去 30 天)
显示 更早的评论
Hello,
I am running a large amount of code in Matlab 2010b with Java 1.7.0_55-b13, to build a dataset for machine learning. The code is based on CERR (www.CERR.info), it opens, modifies and saves structures containing DICOM fields and large matrices. After running the code via a GUI on about 100 files, the code slows down and the following error appears:
_
Exception in thread "Timer-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "RequestQueue for GenericFileList" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
??? Error using ==> drawnow
UIJ_AreThereWindowShowsPending - timeout waiting for window to show up_
I have already increased the java Heap size to the maximum via the Matlab preferences, and i call the garbage collector regularly. I have monitored the java memory using the jConsole, and it shows that the threads are stable, there are no objects pending finalisation, but the Java Heap memory steadily increases as does the number of classes. Memrory Pools 'CMS old Gen' and "Code cache" also keep increasing increasing. Is there anything i can modify in the code to avoid this? For example list or delete java objects? Any help would be very much appreciated. Thank You!
B
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call Java from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!