Thread Subject: memory usage

Subject: memory usage

From: arun

Date: 23 Sep, 2009 17:35:11

Message: 1 of 8

Hi,

I am running my simulations now and the data I deal with are
relatively huge. I would like to know the total/maximum memory
required in running the code.
Is this possible? I run Matlab on Mac OS X 10.6.1

best, arun.

Subject: memory usage

From: Sebastiaan

Date: 23 Sep, 2009 21:35:08

Message: 2 of 8

arun <aragorn168b@gmail.com> wrote in message <ad3190d5-6e0f-492e-adec-c65245b637b0@d34g2000vbm.googlegroups.com>...
> Hi,
>
> I am running my simulations now and the data I deal with are
> relatively huge. I would like to know the total/maximum memory
> required in running the code.
> Is this possible? I run Matlab on Mac OS X 10.6.1
>
> best, arun.

Use the profiler, with the memory option (which is undocumented for some unknown reason):

profile -memory on
% run your code
profreport

The profiler now returns memory usage statistics. Note that the memory option has an impact on your execution speed.

Sebastiaan

Subject: memory usage

From: arun

Date: 23 Sep, 2009 21:44:02

Message: 3 of 8

On Sep 23, 11:35 pm, "Sebastiaan "
<s.breedv...@erasmusmc.REMOVE.BOO.BOO.nl> wrote:
> arun <aragorn1...@gmail.com> wrote in message <ad3190d5-6e0f-492e-adec-c65245b63...@d34g2000vbm.googlegroups.com>...
> > Hi,
>
> > I am running my simulations now and the data I deal with are
> > relatively huge. I would like to know the total/maximum memory
> > required in running the code.
> > Is this possible? I run Matlab on Mac OS X 10.6.1
>
> > best, arun.
>
> Use the profiler, with the memory option (which is undocumented for some unknown reason):
>
> profile -memory on
> % run your code
> profreport
>
> The profiler now returns memory usage statistics. Note that the memory option has an impact on your execution speed.
>
> Sebastiaan

Hi Sebastiaan,

thank you once again for your reply.
In that case, i will have to check twice, once with the *memory on* to
check for the space-requirement and second time without to check the
time elapsed, i guess.

best, arun.

Subject: memory usage

From: Sebastiaan

Date: 24 Sep, 2009 09:44:04

Message: 4 of 8

> Hi Sebastiaan,
>
> thank you once again for your reply.
> In that case, i will have to check twice, once with the *memory on* to
> check for the space-requirement and second time without to check the
> time elapsed, i guess.
>
I "guess" (I have never really measured it) that the profiler will still make the code run slower, even with memory off.

If you want to measure your runtimes accurately, use the clock/tic-toc:
T1 = clock;
  % run piece of code
  T2 = clock;
    % run another piece of code
  T2=etime(clock, T2);
T1 = etime(clock, T1);
fprintf('Piece of code took %f seconds and another piece of code took %f seconds.\n', T1, T2);

Subject: memory usage

From: ali

Date: 4 Feb, 2010 10:19:05

Message: 5 of 8

Can we take the result matlab gui
pls someone help
for example we execute function with gui then how much is it use memoty can we take this 'text' to gui?

Subject: memory usage

From: Sebastiaan

Date: 4 Feb, 2010 13:09:20

Message: 6 of 8

"ali " <rebelfirst@gmail.com> wrote in message <hke6up$38n$1@fred.mathworks.com>...
> Can we take the result matlab gui
> pls someone help
> for example we execute function with gui then how much is it use memoty can we take this 'text' to gui?

At least with 2009b you can do this:

profile on
....
profile off
a = profview;

a gives you a HTML string. You can also view it by function. Or save it to disk with profsave.

Sebastiaan

Subject: memory usage

From: ali

Date: 4 Feb, 2010 16:10:08

Message: 7 of 8

thanks attention Sebastian but ı cant use it
a=profview
then ı have to write save a?

if your answer yes
then
how can ı take allocated memory value to matlab gui text?

Subject: memory usage

From: Sebastiaan

Date: 4 Feb, 2010 20:12:04

Message: 8 of 8

"ali " <rebelfirst@gmail.com> wrote in message <hkergv$eje$1@fred.mathworks.com>...
> thanks attention Sebastian but ı cant use it
> a=profview
> then ı have to write save a?
>
> if your answer yes
> then
> how can ı take allocated memory value to matlab gui text?
Depends on what you want: profview returns a one-line HTML string, with the makeup that you see in the gui. You need to parse the HTML string to extract the data you need. However, that is beyond my ability too.

You may try to parse it to an xml parser (see xml_io_tools for example at the file exchange), so it results a structure.

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 usage Sprinceana 24 Sep, 2009 02:42:46
rssFeed for this Thread

Contact us at files@mathworks.com