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:
zeros(100000, 3000); --> is possible

Subject: zeros(100000, 3000); --> is possible

From: Sofia Häggberg

Date: 4 Aug, 2010 17:16:09

Message: 1 of 7

since I get:
??? Out of memory. Type HELP MEMORY for your options.

any help...?

Subject: zeros(100000, 3000); --> is possible

From: us

Date: 4 Aug, 2010 17:21:14

Message: 2 of 7

On Aug 4, 7:16 pm, "Sofia Häggberg" <hd.int.assNOS...@gmail.com>
wrote:
> since I get:
> ??? Out of memory. Type HELP MEMORY for your options.
>
> any help...?

???
did you do what the error message told you to do(?)...

us

Subject: zeros(100000, 3000); --> is possible

From: Joseph

Date: 4 Aug, 2010 17:30:26

Message: 3 of 7

Sofia,
you are probably limited by the memory on your machine. Type
memory

in MatLab's command window to see what's available

Your matrix will contain 3*10^9 double elements... that's a lot of space.

Do you need doubles? Check out
doc zeros

for ways to reduce the memory needed for this array

"Sofia Häggberg" <hd.int.assNOSPAM@gmail.com> wrote in message <i3c78o$igm$1@fred.mathworks.com>...
> since I get:
> ??? Out of memory. Type HELP MEMORY for your options.
>
> any help...?

Subject: zeros(100000, 3000); --> is possible

From: Sean

Date: 4 Aug, 2010 17:33:06

Message: 4 of 7

us <us@neurol.unizh.ch> wrote in message <3f3c07de-07ed-420d-a762-2d5098db2683@w30g2000yqw.googlegroups.com>...
> On Aug 4, 7:16 pm, "Sofia Häggberg" <hd.int.assNOS...@gmail.com>
> wrote:
> > since I get:
> > ??? Out of memory. Type HELP MEMORY for your options.
> >
> > any help...?
>
> ???
> did you do what the error message told you to do(?)...
>
> us

8 (Bytes)/(element)*(100000*3000 elements) = 2.4*10^9 bytes. You'll need a 64bit system and a lot of RAM to do that...

Subject: zeros(100000, 3000); --> is possible

From: Walter Roberson

Date: 4 Aug, 2010 18:21:16

Message: 5 of 7

Sofia Häggberg wrote:
> since I get:
> ??? Out of memory. Type HELP MEMORY for your options.
>
> any help...?

It would help if you replied to the points I mentioned before:

- Are you using a 32 bit or 64 bit Matlab on your OSX 10.6 system?

- How much RAM do you have?

- How much swap space have you configured?


Unfortunately I do not know a command-line way to determine the configured
swap space in OSX 10.6.

Subject: zeros(100000, 3000); --> is possible

From: Steven_Lord

Date: 4 Aug, 2010 19:08:38

Message: 6 of 7



"Sofia H채ggberg" <hd.int.assNOSPAM@gmail.com> wrote in message
news:i3c78o$igm$1@fred.mathworks.com...
> since I get:
> ??? Out of memory. Type HELP MEMORY for your options.
>
> any help...?

As others have said, this matrix is going to require a LARGE contiguous
block of memory.

numElements = 100000*3000;
numBytes = numElements*8;
numGB = numBytes/(1024^3)

In order to create this matrix you need a contiguous block of over 2 GB
worth of memory. Doing anything _with_ this matrix may require another
block the same size, depending on what you're trying to do with it.

Whether or not there's an alternative depends on what, SPECIFICALLY, you're
trying to do with it. For example, storing this as a sparse matrix (HELP
SPARSE) may help as long as whatever function you're trying to use on it
supports sparse matrices.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: zeros(100000, 3000); --> is possible

From: Stan Bischof

Date: 4 Aug, 2010 20:24:50

Message: 7 of 7

"Sofia Hagberg" <hd.int.assNOSPAM@gmail.com> wrote:
> since I get:
> ??? Out of memory. Type HELP MEMORY for your options.
>
> any help...?


 zeros(100000, 3000); it is completely possible. Just did
it using R2010A. Howevr it takes the Matlab process size
to 3.5GB since that is a large block of data.

That means that unless you are running 64-bit code on
a 64-bit OS you are going to not be able to proceed.

I'd bet you are on 32-bits in which case the error message
you are seeing is exactly correct- "out of memory"

Stan

PS - zeros(100000, 30000); also works- but of course
      it takes scads of RAM

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