Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
saveas swallowing memory

Subject: saveas swallowing memory

From: Bradley Steel

Date: 15 Aug, 2013 09:41:11

Message: 1 of 3

Hi,

I have, until recently, been using saveas in scripts to save figures to file after generation.

I've never had a problem - until about a week ago, when MATLAB froze every time it called saveas. It seems to be running out of memory (using all RAM on a 16GB RAM machine).

Wierdly, if I call saveas from the figure menu, it saves without problems.

I am assuming that the default rendering resolution for saveas (which calls the print command) has been changed. I played with some print command function calls before this problem occurred, but didn't know it was possible to change the defaults or functionality of saveas and don't know how to change it back.

Or ... well, I don't know what else could make working code suddenly suck memory.

Any suggestions?

Subject: saveas swallowing memory

From: Steven_Lord

Date: 15 Aug, 2013 13:48:51

Message: 2 of 3



"Bradley Steel" <starstrike99@yahoo.com.au> wrote in message
news:kui7nm$ge0$1@newscl01ah.mathworks.com...
> Hi,
>
> I have, until recently, been using saveas in scripts to save figures to
> file after generation.
>
> I've never had a problem - until about a week ago, when MATLAB froze every
> time it called saveas. It seems to be running out of memory (using all
> RAM on a 16GB RAM machine).
>
> Wierdly, if I call saveas from the figure menu, it saves without problems.
>
> I am assuming that the default rendering resolution for saveas (which
> calls the print command) has been changed. I played with some print
> command function calls before this problem occurred, but didn't know it
> was possible to change the defaults or functionality of saveas and don't
> know how to change it back.
> Or ... well, I don't know what else could make working code suddenly suck
> memory.
>
> Any suggestions?

This feels to me like it's going to be difficult to diagnose over the
newsgroup. I recommend you contact your local Technical Support staff and
work with them to determine why the behavior changed (graphics driver
update? OS update? Someone modifying files in your installation?) along with
why you don't see this same behavior going through the menu as opposed to
programmatically.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: saveas swallowing memory

From: Isabella Osetinsky

Date: 15 Aug, 2013 15:25:08

Message: 3 of 3

Hey Brad, download the wonderful "export_fig" package from the user forum. I just did it yesterday/today and got amazing results. Add '-a1' i option in the "export_fig" command and close each figure with "close" command immediately after "export_fig" command. It solved my computer memory problems as well! See my today's comment in the "export_fig" homepage. Good luck! isabella

"Bradley Steel" <starstrike99@yahoo.com.au> wrote in message <kui7nm$ge0$1@newscl01ah.mathworks.com>...
> Hi,
>
> I have, until recently, been using saveas in scripts to save figures to file after generation.
>
> I've never had a problem - until about a week ago, when MATLAB froze every time it called saveas. It seems to be running out of memory (using all RAM on a 16GB RAM machine).
>
> Wierdly, if I call saveas from the figure menu, it saves without problems.
>
> I am assuming that the default rendering resolution for saveas (which calls the print command) has been changed. I played with some print command function calls before this problem occurred, but didn't know it was possible to change the defaults or functionality of saveas and don't know how to change it back.
>
> Or ... well, I don't know what else could make working code suddenly suck memory.
>
> Any suggestions?

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us