Thread Subject: Memory limit workaround

Subject: Memory limit workaround

From: Thiago

Date: 8 Feb, 2009 18:40:04

Message: 1 of 4

I have a 3GHz pentium 4 with 1GB of RAM and 1524MB of virtual memory. Even with this modest system, I am able to compose a 1x61276 character array in MATLAB. This array has 3 variables in combination with a variety of complex numbers cast into string-form. If I run eval( arg ), where arg is this huge array, I am supposed to obtain a 2x1 symbolic matrix. However, I get the following error message:

??? Error using ==> horzcat
Out of memory. Type HELP MEMORY for your options.

Error in ==> sym.sym>findrun at 536
d = diff([0 x 0]);

Error in ==> sym.sym>char2sym at 437
   [b,e] = findrun(sp); % Beginning (b) and end (e) indices.

Error in ==> sym.sym at 92
   S = char2sym(x);

Error in ==> sym.maple at 92
   result = sym(result);

Error in ==> sym.mtimes at 28
   X = maple(A,'&*',B);

I've already increased virtual memory and ran disk defragmenter. I've also cleared all workspace variables, except for the (sym) and (char) variables that are part of my expression, before calling eval(). At this point, I see no alternative other than buying more physical memory or trying to get hold of a super-computer! Maybe there is a workaround that I haven't tried yet. If so, please let me know. Thanks.

PS: I posted the 1x61276 character array here: http://people.rit.edu/tsj9205/

Subject: Memory limit workaround

From: Image Analyst

Date: 8 Feb, 2009 20:13:02

Message: 2 of 4

One option is to use Star-P (http://www.interactivesupercomputing.com/products/). If you use Star-P, you can have tens of terabytes in memory (or at least the appearance of such due to some tricks they play with memory management). Pretty much eliminates any memory issue you'd ever have.

Subject: Memory limit workaround

From: Thiago

Date: 8 Feb, 2009 20:33:01

Message: 3 of 4

That's brilliant! Thank you for your suggestion. I'm going to get a license through my school.

Subject: Memory limit workaround

From: Steven Lord

Date: 10 Feb, 2009 21:50:41

Message: 4 of 4


"Thiago " <thiago@mathworks.com> wrote in message
news:gmn8u4$dks$1@fred.mathworks.com...
>I have a 3GHz pentium 4 with 1GB of RAM and 1524MB of virtual memory. Even
>with this modest system, I am able to compose a 1x61276 character array in
>MATLAB. This array has 3 variables in combination with a variety of complex
>numbers cast into string-form. If I run eval( arg ), where arg is this huge
>array, I am supposed to obtain a 2x1 symbolic matrix. However, I get the
>following error message:

*snip*

> PS: I posted the 1x61276 character array here:
> http://people.rit.edu/tsj9205/

Rather than performing the explicit multiplication to extract the first
column of the matrix, why not just create the matrix using the first 61269
characters (removing the "* [1;0]") and index into it to extract the first
column. That's all that multiplication is doing, and that's where you're
running out of memory.

Alternately, if you don't need one or all of the variables to be symbolic
(i.e. you know values for those variables ahead of time) assign values to
those variables and then evaluate your string. Performing the calculations
numerically will be MUCH quicker and will avoid using so much memory. [If
you're trying to create the matrix symbolically so you can later substitute
values in repeatedly, instead assign values to those variables repeatedly
and evaluate the expression numerically.]

--
Steve Lord
slord@mathworks.com

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
memory Thiago 8 Feb, 2009 13:40:05
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com