Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Activity Monitor lets me see how much memory is allocated as "wired", but I can't find a way to break the allocation down by applications or other memory consumers.

Is there a tool out there that lets me get this information?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

I found a webpage which has this definition for wired memory:

Wired memory is used by the OS and is pretty much untouchable. Another application can't "borrow" wired memory

If you want to know more about how applications and frameworks are using memory on your system, try /usr/bin/allmemory. You must run it as root; sudo /usr/bin/allmemory is one way to accomplish that. When you run it, it will perform analysis for several seconds before showing output.

Here is a short example of the output:

                           Process Name [ PID]  Architecture    PrivateRes/NoSpec   Copied    Dirty    Swapped   Shared/NoSpec
                           ===================  ============    ================= ========= ========= =========  =============

                             WebProcess [ 317]:    64-bit        74126  /   73588      2102     48868       403  32777 / 30757
                                  Xcode [ 368]:    64-bit        55780  /   55711     25228     45570       595  43660 / 41720
                                 Safari [ 315]:    64-bit        25087  /   25087      2251     17647        52  35197 / 33513

See the allmemory man page (with the command man allmemory) for more details; here's an explanation of some of the columns:

PrivateRes: the number of pages resident in physical memory, not shared with other processes

Copied/Dirty: the number of resident pages that were copied or are dirty (non-exclusive)

Swapped: the number of pages that were in memory but have been swapped to disk.

Shared: the number of shared pages

share|improve this answer
1  
Very useful, thanks! The swapped-out pages was another piece of information I had been looking for. –  Monolo Feb 10 '12 at 23:50
    
“wired” memory is not specifically memory used by the OS, but rather memory that has been “locked” into RAM with mlock() or something similar. mlock()ed memory cannot be swapped out to the hard drive. Usually locked memory will belong to the OS, but this is not guaranteed at all. You can write a program that allocates and locks a chunk of memory for itself, no problem. I imagine this might be practical for storing passwords or other sensitive information to prevent traces being left on disk. (No downvote for this; it's not related to the actual question, and it's not terribly important.) –  Blacklight Shining Oct 14 '13 at 21:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.