how to save work space?

2 次查看(过去 30 天)
MURTADHA ALDEER
MURTADHA ALDEER 2012-7-26
Dears
I am trying to save the workspace of my simulation program, however I get this message
Not enough memory to read file contents: Java heap space
Could you please help me with this!
regards

回答(3 个)

Thomas
Thomas 2012-7-26
编辑:Thomas 2012-7-26
You could increase the Java Heap size as follows:
Windows:File->Preferences->General->Java heap space
Mac: MATLAB->Prefernces->General-> Java Heap Memory
Move the slider to maximum available Java Heap size and see if you still get the error
USe save or matfile to save your workspace
doc save
doc matfile
  3 个评论
MURTADHA ALDEER
MURTADHA ALDEER 2012-7-28
I am using Matlab R 2008a, when I used the commands in the blog I got this message when running my program?
Not enough memory to read file contents: Java heap space Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOfRange(Unknown Source) at java.lang.String.<init>(Unknown Source) at org.netbeans.editor.DocumentContent.getText(DocumentContent.java:152) at org.netbeans.editor.DocumentContent.getString(DocumentContent.java:142) at javax.swing.text.AbstractDocument.getText(Unknown Source) at com.mathworks.widgets.text.mcode.BaseDocumentMTreeProvider.getTextFromDocument(BaseDocumentMTreeProvider.java:56) at com.mathworks.widgets.text.mcode.MTreeDocumentProvider.getText(MTreeDocumentProvider.java:25) at com.mathworks.widgets.text.mcode.MTreeDocumentProvider.getMTree(MTreeDocumentProvider.java:63) at com.mathworks.widgets.text.mcode.MTreeBaseDocumentCache.getMTree(MTreeBaseDocumentCache.java:35) at com.mathworks.widgets.text.mcode.MFoldManager.getInitialFoldsInfo(MFoldManager.java:408) at com.mathworks.widgets.text.mcode.MFoldManager.createFolds(MFoldManager.java:273) at com.mathworks.widgets.text.mcode.MFoldManager.initFolds(MFoldManager.java:87) at org.netbeans.modules.editor.fold.FoldOperationImpl.initFolds(FoldOperationImpl.java:96) at org.netbeans.modules.editor.fold.FoldHierarchyExecution.rebuildManagers(FoldHierarchyExecution.java:643) at org.netbeans.modules.editor.fold.FoldHierarchyExecution.rebuild(FoldHierarchyExecution.java:576) at org.netbeans.modules.editor.fold.FoldHierarchyExecution$2.run(FoldHierarchyExecution.java:749) 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) Exception in thread "Thread-7" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOfRange(Unknown Source) at java.lang.String.<init>(Unknown Source) at org.netbeans.editor.DocumentContent.getText(DocumentContent.java:152) at org.netbeans.editor.DocumentContent.getString(DocumentContent.java:142) at javax.swing.text.AbstractDocument.getText(Unknown Source) at com.mathworks.widgets.text.mcode.MLintDecorator.doMLint(MLintDecorator.java:998) at com.mathworks.widgets.text.mcode.MLintDecorator.access$2300(MLintDecorator.java:36) at com.mathworks.widgets.text.mcode.MLintDecorator$MLintRunnable.run(MLintDecorator.java:1143) at java.lang.Thread.run(Unknown Source)

请先登录,再进行评论。


Sumit Tandon
Sumit Tandon 2012-7-26
How are you saving the workspace? If you are saving variables to MAT-files, then consider using MATFILE command. It allows saving variable partially - using less memory in the process.

venkat vasu
venkat vasu 2012-7-26
save('filename','A','-append') use this code
this may be useful for you.

标签

Community Treasure Hunt

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

Start Hunting!

Translated by