Why do I get a java.lang.OutOfMemoryError exception when resizing my figure?
3 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2016 年 4 月 4 日
編集済み: MathWorks Support Team
2021 年 3 月 3 日
Whenever I try to increase the size of my figure, the figure contents do not increase accordingly, and I get the following error. Why is this happening?
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space at java.awt.image.DataBufferInt.<init>(Unknown Source) at java.awt.image.Raster.createPackedRaster(Unknown Source) at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source) at java.awt.GraphicsConfiguration.createCompatibleImage(Unknown Source) at java.awt.GraphicsConfiguration.createCompatibleImage(Unknown Source) at sun.awt.image.SunVolatileImage.getBackupImage(Unknown Source) at sun.awt.image.VolatileSurfaceManager.getBackupSurface(Unknown Source) at sun.awt.image.VolatileSurfaceManager.initialize(Unknown Source) at sun.awt.image.SunVolatileImage.<init>(Unknown Source) at sun.awt.image.SunVolatileImage.<init>(Unknown Source) at java.awt.GraphicsConfiguration.createCompatibleVolatileImage(Unknown Source) at java.awt.GraphicsConfiguration.createCompatibleVolatileImage(Unknown Source) at javax.swing.RepaintManager.getVolatileOffscreenBuffer(Unknown Source) at javax.swing.RepaintManager$PaintManager.paint(Unknown Source) at javax.swing.RepaintManager.paint(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source) at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source) at sun.awt.SunGraphicsCallback.runComponents(Unknown Source) at java.awt.Container.paint(Unknown Source) at java.awt.Window.paint(Unknown Source) at javax.swing.RepaintManager$3.run(Unknown Source) at javax.swing.RepaintManager$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.access$1100(Unknown Source) at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
採用された回答
MathWorks Support Team
2021 年 3 月 3 日
編集済み: MathWorks Support Team
2021 年 3 月 3 日
This error means MATLAB is running out of Java Heap memory. To work around this issue simply increase the Java Heap using the following documentation link:
This issue can occur when using a computer screen with many pixels (e.g. very high resolution screen). The reason for this is that MATLAB must allocate enough memory in the Java Heap to account for all the pixels a figure takes. As such, when there are a lot of pixels, the amount of memory necessary is higher. While MATLAB's default heap size is sufficient in most cases, in cases where the total number of pixels is high (e.g. very high resolution screens, multiple screens, etc.) a larger heap size may be necessary.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!