76

I'm trying to figure out what is using all of the memory in my Macbook Pro running OS X Lion. I have 8 GB of memory total. When I quit all active programs except Finder and Activity Monitor, then run a memory cleanup (FreeMemory) it shows about 5 GB of Free Memory, 1 GB of Active Memory, and 1.5 of Wired memory. Support docs say Wired Memory is full of stuff that "can't be moved to disk". What is taking up all of that memory? Is it the menubar processes? I have mozy, last.fm, dropbox, and growl running in the menubar but they all appear in Activity Manager and don't appear to be using a significant amount of memory. I also run Parallels but it is shut down completely so I thought all of it's stuff should be written to disk. Is it just Mac OS X using a reserved chunk of memory and labeling it "Wired"?

2

8 Answers 8

61

From what I can tell, wired memory belongs to the kernel, the innermost core of Mac OS X. It's many layers removed from the icons in the menubar, which are just ordinary apps showing themselves in an odd way.

Wired memory is used for some of the core functions of the operating system—things like keeping track of all the applications on your system, or open files and network connections, or chunks of memory used by various drivers. The "page tables" that form a map of your system's memory are also stored in wired memory, and a system with more memory needs larger page tables. I suspect that the memory used by the integrated video chips in most Macs is wired as well, but I can't find anything that says that outright. In any case, much of this information is needed to manage and access memory, and so it can't itself be swapped out to disk!

To understand why, imagine an enormous library. Think of, for example, the Bodleian Library at the University of Oxford, which has eleven million printed items. There's no way you could possibly fit all that stuff into a single building—certainly not one in the middle of a university campus.

So instead, imagine that the librarians construct a vast warehouse. (The real Bodleian Library has about forty sub-libraries of various descriptions, plus storage for really rare books, but this is a thought experiment.) Most of the books are kept in the warehouse, but anything that's been used recently is kept in the library. If you show up at the library looking for a book, and it's in the stacks there, you can read it immediately. If not, ask a librarian and the book you want will be transported from the warehouse and given to you the next day.

The information in wired memory, then, would be things like the card catalog, keys to the book delivery trucks, and maps of the route to the warehouse. If you stored these things in the warehouse, you could never retrieve books to bring them back to the library—so they must be kept in the library at all times, lest the whole system break down.

Anyway, getting back to practical considerations: wired memory is basically used by your computer for internal bookkeeping of various sorts. You shouldn't worry about it.

And don't worry if you have lots of "inactive" memory and little "free" memory, either. Inactive memory is basically memory that Mac OS is keeping something in on the off chance it's needed again; if your system needs that memory for something else, it'll be converted to free memory without any performance hit.

To extend the library metaphor, imagine that the library keeps books that have been recently used in the stacks. The space is there in the stacks; there's no use leaving it empty, so you might as well keep the books you already have there. There's no harm in it, and sometimes someone will be able to pick up a book immediately that he would otherwise have had to wait for.

Similarly, inactive memory can only speed things up; it can't hurt your computer, so don't worry about it being too high.

Really, you shouldn't worry about your memory use unless wired + active starts getting close to the 8 GB in your computer. That's when you could get into trouble, because that's when Mac OS will start consuming disk space to add "extra" memory, damaging performance considerably.

Otherwise, you might as well have something in that memory. Ultimately, unused memory is just a waste of power—if you have it, you might as well put it to use.

5
  • 2
    Inactive memory can only speed things up when the set of applications used (and therefore left in inactive memory) is fairly constant and doesn't vary widely. If the OS has to page out something that's in inactive memory to launch a new app, it can slow things down. This doesn't happen frequently, but it's worth mentioning.
    – alesplin
    Commented Nov 22, 2011 at 21:18
  • Saying that inactive memory can only be good for you is the biggest lie of the Mac world! In practice, Apple computers can't work if you don't have a lot of inactive memory. Try 'purging' this memory and all your programs will stall until the inactive memory is back to around 25% of your total RAM (tested on Mac OS X 10.6 and 10.7). And if what you say is true for wired memory, then why does Mac OS X needs so much of it? My computer (4GB) uses constantly at least 800MB of wired and 1GB of "inactive" memory. Nothing can explain that but bad design!
    – PierreBdR
    Commented Nov 3, 2012 at 14:51
  • 3
    If your Mac uses integrated graphics (as opposed to an expensive, power-hungry discrete graphics chip), all the memory used by the graphics card is wired. This alone is 384 MB on my 13" MacBook Air. Thunderbolt controllers also need lots of wired memory, and I wouldn't be surprised if hard disk buffers do too. A couple hundred megabytes here, a couple hundred there, soon you're talking about real memory. The question is, is your Mac under memory pressure? If it's not, quit obsessing over Activity Monitor and get something done. Commented Nov 4, 2012 at 3:31
  • Just to append: I'm using Parallels for my Windows virtual machine and its 8GB reserved memory is categorized as 'wired memory'.
    – Nullius
    Commented Jul 13, 2017 at 13:08
  • It couldn't be more detailed! Thank you for your effort and your time
    – BabyBoy
    Commented Feb 23, 2021 at 8:12
29

Reading system memory usage in Activity Monitor

from support.apple.com gives a detailed explanation about the different "types" of RAM.

  • Free memory: This is RAM that's not being used.

  • Wired memory: Information in this memory can't be moved to the hard disk, so it must stay in RAM. The amount of Wired memory depends on the applications you are using.

  • Active memory: This information is currently in memory, and has been recently used.

  • Inactive memory: This information in memory is not actively being used, but was recently used.

  • Used: This is the total amount of memory used.

3
12

For a definitive, although OS specific, answer, from Memory Usage Performance Guidelines:

Wired Memory

Wired memory (also called resident memory) stores kernel code and data structures that must never be paged out to disk. Applications, frameworks, and other user-level software cannot allocate wired memory. However, they can affect how much wired memory exists at any time. For example, an application that creates threads and ports implicitly allocates wired memory for the required kernel resources that are associated with them.

Table 2 lists some of the wired-memory costs for application-generated entities

Wired memory generated by user-level software

As you can see, every thread, process, and library contributes to the resident footprint of the system. In addition to your application using wired memory, however, the kernel itself requires wired memory for the following entities:

  • VM objects
  • the virtual memory buffer cache
  • I/O buffer caches
  • drivers

Wired data structures are also associated with the physical page and map tables used to store virtual-memory mapping information, Both of these entities scale with the amount of available physical memory. Consequently, when you add memory to a system, the amount of wired memory increases even if nothing else changes. When a computer is first booted into the Finder, with no other applications running, wired memory can consume approximately 14 megabytes of a 64 megabyte system and 17 megabytes of a 128 megabyte system.

Wired memory pages are not immediately moved back to the free list when they become invalid. Instead they are “garbage collected” when the free-page count falls below the threshold that triggers page out events.

7

There are several very good answers and I wanted to add a tool that anyone can use to document exactly what wired memory is in use - so a specific answer as opposed to a general explanation of the categories.

In the case where all Applications are quit and there is still a sizable amount of wired memory, you can use the sysdiagnose command to capture the system memory allocation when it is using more memory than you expect.

Then save / move the tar.gz archive of results out of /var/tmp to the Desktop so that they don't get erased upon reboot.

Then reboot your Mac and before launching any extra programs, repeat the sysdiagnose command and compare memory before and after to see what processes were taking the extra wired memory.

1
  • 1
    sysdiagnose does a lot of things it's not at all clear how to use it to debug memory.
    – Matt
    Commented Dec 10, 2020 at 21:09
6

Mac OS X is a modern OS, thus is uses virtual memory to make it appear to apps that memory space is no object. Most recently used apps will tend to be moved to RAM, less used apps will be moved to the hard disk (page ins and page outs are a sign of that movement). The OS will not use the hard drive until it runs out of space in RAM.

There is no specific app that will "cause" this wired memory to accumulate. The OS is managing every parts of itself and the apps you launched to make the best use of the RAM you have.

Quitting unused apps, or better yet, restarting the computer will be the most efficient way to "clean up" the memory. FreeMemory does a good job, and am surprised the OS isn't doing such operation from time to time… it's nice to have a status on free memory though!

3
  • 8
    More specifically wired memory is memory that cannot be paged. Any other application have its memory placed in the swap file but wired memory always remains in the real ram. Some of the most common users of wired memory are visualization applications (Parallels, VMWare) and the mac os x operating system. Also don't worry if you don't have much free memory, inactive memory is as good as free because it can be reallocated to any application that needs it. Lots of page in's and out's are a good sign that you need more ram though
    – MikelR
    Commented Nov 21, 2011 at 1:51
  • I agree, lots of page ins and outs is a sign of not enough ram. I have 8 gb of ram in my system, and I frequently run out of "free" space, running Xcode and adobe apps... I am thinking about putting 16 gb soon, once the price goes below 500$. I hope it'll be enough for awhile! :-)
    – Fred
    Commented Nov 21, 2011 at 3:35
  • Switching from a MBP with 6GB ram to a MBA with 4GB ram made me realize that SSDs are a lot better upgrade than extra RAM. 4GB with an SSD is enough to run Chrome, Mail, Skype, VMWare Fusion, iTunes, Aperture, Adium, OmniFocus and more all at once without hiccups. Going from 4 to 6GB on my MBP didn't make an enormous difference.
    – w00t
    Commented Nov 22, 2011 at 21:36
2

'Oh yeah, and wired memory turns out to be memory "used by the OS [which] is pretty much untouchable. Another application can't 'borrow' wired memory'

from tuaw http://www.tuaw.com/2007/03/06/just-what-is-wired-memory-anyway/

2

Wired memory is any memory that can't be swapped for any reason, which includes most kernel allocations. The zprint terminal command will print a breakdown.

-4

virtual memory is basically free __ space used as an extension of ram

1
  • Virtual memory may be "free" as in "the cost paid for RAM isn't affected" (though it contributes something to the cost paid for disk storage) or "free" as in "using no RAM to hold it's contents" (not quite true since it requires a small amount of RAM for its management), but since the cost of memory is usually considered more in terms of it's effect on the speed of operation and accessing it is so much slower than accessing RAM that it can hardly be considered to be "basically free".
    – Zhora
    Commented Apr 6, 2015 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .