Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4589952
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:10:08+00:00 2026-05-21T22:10:08+00:00

I’ve got a copy of Matlab from 2004 (forgot what the version number would

  • 0

I’ve got a copy of Matlab from 2004 (forgot what the version number would be, but it certainly is old), and I could use the “features memstat” command to see how much memory is available to Matlab. The command no longer works for me in Matlab 2010b, what should I do to see available memory? Thanks.

P.S. I tried the “memory” command as suggested by @Rasman but got the following error:

??? Error using ==> memory Function
MEMORY is not available on this
platform.

I am running Matlab 2010b for Mac OS X 64-bit.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T22:10:09+00:00Added an answer on May 21, 2026 at 10:10 pm

    Use unix('vm_stat'); in MATLAB on a Mac. This gives, for example:

    Mach Virtual Memory Statistics: (page size of 4096 bytes)
    Pages free:                        1580152.
    Pages active:                       184679.
    Pages inactive:                      64572.
    Pages speculative:                   63389.
    Pages wired down:                   203816.
    "Translation faults":              3906655.
    Pages copy-on-write:                301846.
    Pages zero filled:                 1899205.
    Pages reactivated:                       0.
    Pageins:                            107102.
    Pageouts:                                0.
    Object cache: 15 hits of 32166 lookups (0% hit rate)
    

    Results are in pages of 4096 bytes, so multiply results by 4096 and you get values consistent with Activity Monitor (you have to add ‘speculative’ to ‘free’ to get exact agreement). If you just want the available memory, you can use unix('vm_stat | grep free');. If you want a number you could use something like:

    [s,m]=unix('vm_stat | grep free');
    spaces=strfind(m,' ');
    str2num(m(spaces(end):end))*4096
    

    EDIT: in response to a comment below “It doesn’t tell you how much MATLAB used up and how much more MATLAB can use.” Here is what I do for that additional question.

    From my experience, 64 bit MATLAB can use up all of the free memory (and more but it slows down a lot if you start swapping much). One of my systems has 22Gb and it has no trouble using all of that. If you’re using 32 bit MATLAB you’re limited to 2Gb.

    To see the total memory, you can add up ‘free’+’active’+inactive’+’speculative’+’wired’ from vm_stat (and multiply by 4096). Or, if you just want the total memory, you can use unix('sysctl hw.memsize | cut -d: -f2') (in bytes).

    To get the memory used by MATLAB, is slightly more involved. The memory is used by the controlling process. If you just use unix('ps'), you’ll get the memory used by matlab_helper. So I use:

    % get the parent process id
    [s,ppid] = unix(['ps -p $PPID -l | ' awkCol('PPID') ]); 
    % get memory used by the parent process (resident set size)
    [s,thisused] = unix(['ps -O rss -p ' strtrim(ppid) ' | awk ''NR>1 {print$2}'' ']); 
    % rss is in kB, convert to bytes 
    thisused = str2double(thisused)*1024 
    

    Above I’ve used a little awk function which picks off a named column:

    function theStr = awkCol(colname)
    theStr  = ['awk ''{ if(NR==1) for(i=1;i<=NF;i++) { if($i~/' colname '/) { colnum=i;break} } else print $colnum }'' '];
    

    A little tutorial of the unix command to explain the above, in case it helps anyone. unix('command') on its own shows you the output and returns the status. If you want to process the output, use [s,w] = unix('command') and deal with the string output in w. If you want to ignore the s output, in later versions of MATLAB, you can use [~,w] = unix('command'), but I avoid that since I inevitably have different versions on different computers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.