how to save work space?

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

Réponses (3)

Thomas
Thomas le 26 Juil 2012
Modifié(e) : Thomas le 26 Juil 2012

2 votes

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 commentaires

MURTADHA ALDEER
MURTADHA ALDEER le 26 Juil 2012
Thank you for your replay,
Could you please help me in finding the location:
Windows:File->Preferences->General->Java heap space
I am using windows 7, but could not find the folder File. Do you mean its in the MATLAB folder, there is no such folder as well?
All the best
MURTADHA ALDEER
MURTADHA ALDEER le 28 Juil 2012
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)

Connectez-vous pour commenter.

Sumit Tandon
Sumit Tandon le 26 Juil 2012

0 votes

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 le 26 Juil 2012

0 votes

save('filename','A','-append') use this code
this may be useful for you.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by