How much memory is used by all functions and subfunctions in my program?

Hi,
I want to know how much memory my program uses during execution. I know that the function whos can be used to list all variables in every workspace. I have tested saving the bytes used by calling whos in every function and saving the size of every variable into a global variable. I thought that, at the end, I would be able to see how much memory my program has used by looking at the global variable. However, I'm encountering a problem. The global variable keeps increasing even after the program has finished, and it seems to never stop.
I'm therefore wondering if there is an easier way to see how much memory the whole program has used?

Answers (1)

Search memory Stuart McGarrity in the File Exchange.
Search "Strategies for Efficient Use of Memory" in the on-line help
Search Undocumented Matlab for memory.

4 Comments

Hi,
Non of those searches helped me find what I was looking for. Could you give me a more specific answer?
"The global variable keeps increasing even after the program has finished" sounds weird to me. I cannot help. You provide to little information.
What OS are you using? If Windows you might find http://technet.microsoft.com/en-us/sysinternals useful.
Okey, but do you know any other way to check the memory usage than using whos?
Yes, I'm using Windows so thanks for the link, I'll look it up.
On MS Windows you can use the MATLAB commands
memory
feature('memstats')
Note: these are not available on the other operating systems.

Sign in to comment.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Tags

Asked:

on 8 Mar 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!