Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Problem with memory usage (R2009a)
Replies: 11   Last Post: Oct 21, 2009 10:20 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Outspan

Posts: 17
Registered: 7/14/09
Re: Problem with memory usage (R2009a)
Posted: Oct 21, 2009 6:57 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Oct 21, 10:52 am, "Sebastiaan "
<s.breedv...@erasmusmc.REMOVE.BOO.BOO.nl> wrote:
> Outspan <borghibor...@gmail.com> wrote in message <d003bdee-a668-4702-9486-b367d1625...@m11g2000vbl.googlegroups.com>...
> > On Oct 20, 1:53?pm, "Bruno Luong" <b.lu...@fogale.findmycountry>
> > wrote:

> > > Outspan <borghibor...@gmail.com> wrote in message <32cf3331-9441-4f73-9b6f-f29d3fbf6...@s6g2000vbp.googlegroups.com>...
> > > > Hi all,
>
> > > >... ?I also use up 300MB of
> > > > memory, and I don't understand why.

>
> > > Because of the REPMAT instruction.
>
> > > > bars = struct('date', [], 'time', [], 'open', [], 'high', [], 'low',
> > > > [], 'close', [], 'volume', []);
> > > > bars = repmat(bars, [1 500000]);

>
> > I wrote earlier that I had 50K lines, but I really have 500K (so the
> > parameters in repmat are correct). Is there a way to do this and use
> > less memory? How come the .mat file is only 10MB but the script is
> > using this much memory?

>
> The .MAT files are compressed, while in memory, the data is raw (decompressed).
>
> About the memory usage after loading the MAT file: what is the output of your 'whos' for the relevant matrix?
>
> Sebastiaan


>> whos

Name Size Bytes Class Attributes

eurusd 1x500000 238000448 struct

but the fields in the struct are 7 doubles, which should put the total
uncompressed size to roughly

>> 500000*7*8

ans =

28000000

and also,

>> a = eurusd(1); whos

Name Size Bytes Class Attributes

a 1x1 924
struct
eurusd 1x500000 238000448 struct

even though every single field of the struct is only 8 bytes in size.
I hope that in its internal representation it's not replicating the
field names 500K times...



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.