How can I avoid a Java out-of-memory error when creating GUI using GUIDE?

2 ビュー (過去 30 日間)
Maria
Maria 2011 年 6 月 21 日
[EDIT: 20110621 17:15 CDT - reformat - WDR]
Exception in thread "Timer-1" java.lang.OutOfMemoryError: Java heap space
at java.lang.String.toLowerCase(Unknown Source)
at java.io.Win32FileSystem.hashCode(Unknown Source)
at java.io.File.hashCode(Unknown Source)
at java.util.HashMap.get(Unknown Source)
at com.mathworks.mlwidgets.explorer.control.DocumentContextImpl.getDocumentChanges(DocumentContextImpl.java:462)
at com.mathworks.mlwidgets.explorer.control.DocumentContextImpl.refreshContents(DocumentContextImpl.java:569)
at com.mathworks.mlwidgets.explorer.control.RefreshDaemon$2.run(RefreshDaemon.java:104)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
at java.lang.AbstractStringBuilder.<init>(Unknown Source)
at java.lang.StringBuilder.<init>(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.getInputMap(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.installKeyboardActions(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.installUI(Unknown Source)
at javax.swing.JComponent.setUI(Unknown Source)
at javax.swing.text.JTextComponent.setUI(Unknown Source)
at javax.swing.text.JTextComponent.updateUI(Unknown Source)
at com.mathworks.hg.peer.EditTextPeer$hgTextField.updateUI(EditTextPeer.java:559)
at com.mathworks.hg.peer.EditTextPeer$hgTextField.setText(EditTextPeer.java:571)
at com.mathworks.hg.peer.EditTextPeer.doSetString(EditTextPeer.java:126)
at com.mathworks.hg.peer.AbstractUicontrolPeer$11.run(AbstractUicontrolPeer.java:552)
at com.mathworks.hg.util.HGPeerQueue$HGPeerRunnablesRunner.runit(HGPeerQueue.java:228)
at com.mathworks.hg.util.HGPeerQueue$HGPeerRunnablesRunner.runNotThese(HGPeerQueue.java:260)
at com.mathworks.hg.util.HGPeerQueue$HGPeerRunnablesRunner.run(HGPeerQueue.java:276)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source
  2 件のコメント
Gerd
Gerd 2011 年 6 月 21 日
Hi Maria,
could you please explain a little bit what you are doing. It looks like using a timer
Maria
Maria 2011 年 6 月 21 日
I am using the timer to check how much time my calculations need to be conducted.I made this tool in matlab that basically calculates energy needs..it also does some kind of optimization but it has a lot of 'for' loops..

サインインしてコメントする。

採用された回答

Friedrich
Friedrich 2011 年 6 月 21 日
Hi Maria,
please try to increase your java heap space from MATLAB. You can find this option under File -> Preferences -> General -> Java Heap Memory. Please make a restart of MATLAB after changing this value.
  4 件のコメント
Sean Lawson
Sean Lawson 2011 年 11 月 9 日
I am using R2010a and I found the option as Friedrich said.
Friedrich
Friedrich 2011 年 11 月 10 日
2010a and higher having this options in the Preferences. For older Mls one has to create a java.opts file. How to do this can be found here:
http://www.mathworks.com/support/solutions/en/data/1-18I2C/index.html

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCall Java from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by