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"?
MacBook Pro – Understanding What Wired Memory Is
macbook promacosmemory
Related Solutions
When the wired and active RAM pass 50% - most tasks are measurably slower. You will see increased paging activity (vm_stat 15
in the terminal - watch for page outs - they indicate some memory had to be written to slow hard drive and constant page out and page in above 10-20 per minute indicates you have a RAM starved system.)
When starved for RAM, you can buy more or do less. You might want to get a monitoring software like Activity Monitor and keep the memory indicator in your dock. The system is likely thrashing based on the time delays you report. Each of the active programs needs some memory that just got paged to disk to free up extra space for memory needed by another program. It is a bad cycle and the computer just spends time running circles rather than getting done the work you wanted.
Here is a mac with every indication of RAM pressure:
But, quitting a large app like Aperture and starting it again still has no paging and the system is very responsive. Ignore the first line after the headings in vm_stat as it's the total since boot, but do watch for pageout as you have apps that are not responsive:
mac:~ me$ vm_stat 15
Mach Virtual Memory Statistics: (page size of 4096 bytes, cache hits 0%)
free active spec inactive wire faults copy 0fill reactive pageins pageout
260482 1186K 74303 275275 234520 323478K 2276158 188709K 120292 640158 482
260689 1187K 74303 275275 234038 4117 0 3256 0 0 0
261310 1185K 74001 275250 235835 10668 77 7115 0 4 0
292087 1153K 74711 274313 236770 32927 972 21684 0 18 0
521469 928347 75754 269861 235897 77208 130 63300 8 41 0
517897 936518 75766 269215 231981 27678 2504 13059 0 22 0
463894 987202 72076 274852 233371 126855 2712 89422 2 50 0
223701 1180K 77834 283568 265396 589512 255 562957 1 7278 0
205013 1186K 82765 291561 265293 389442 255 369664 0 7334 0
201401 1173K 89671 301672 265595 495426 82 472316 1 9286 0
However, starting about 4 of the Adobe CS4 apps can push this machine into thrashing and the slowness you describe with the apps taking 30 seconds to launch and lots of bouncing of square icons in the dock.
Here is the associated vm_stat 15
showing the problem. Look specifically at the free memory plummeting to the minimum and pagein / pageout climbing.
mac:~ me$ vm_stat 15
Mach Virtual Memory Statistics: (page size of 4096 bytes, cache hits 0%)
free active spec inactive wire faults copy 0fill reactive pageins pageout
21822 1190K 4746 585056 228411 332621K 2315577 196418K 121439 781551 1806
86862 1152K 5123 570803 215710 124555 932 102117 0 2086 15
73080 1161K 8631 571301 216607 24404 337 14931 0 1994 0
29655 1196K 13500 572024 219284 188966 535 112913 0 3606 0
1668 1208K 9616 594723 216954 174145 215 144996 16 15268 121
4142 1206K 5795 595393 219564 322750 0 320426 0 1 0
3043 1204K 3485 596990 223264 138981 136 136653 0 28 0
2338 1205K 2782 598556 222416 332263 321 321321 0 164 30
3251 1204K 2919 598770 222027 90135 82 85050 0 5 0
2606 1203K 212 600436 224678 114502 1 112450 0 35 0
1188 1200K 174 600230 228582 162660 117 157230 33127 860 9914
22069 1200K 27612 550547 230304 89953 38 82383 8274 159 2071
1910 1200K 349 600071 227976 24382 0 23465 7332 1 2985
1164 1201K 174 600281 228423 4940 1 4046 7087 8 2500
30404 1203K 186 567418 229475 16087 1 16045 8566 4 2235
The answer is simple: Safari just needs (or wastes) a lot of memory! If you only have 2GB RAM, use Googles Chrome Browser or Firefox.
2GB of RAM is just not enough for todays Computer. Be sure to only open one app at the time, and close it when you are finish.
An Operating System handles the RAM by itself. When it's out of RAM, it stores the user-cache-data on the Hard Drive, so the Computer gets very slow.
And for browsing: Websites with lots of flash content needs more memory, than simple text sites. I've had a MacBook Air with only 2GB of RAM, and it was just impossible to work with!
Related Question
- MacOS – Any way to know what causes allocation of wired memory
- MacOS – Disable inactive memory swapping
- MacBook – The free vs. inactive memory ratio on a Mac with 16 GB RAM has me concerned
- MacOS – what do App Memory, Wired Memory, and Compressed mean
- kernel_task and mdworker Using All RAM Memory – How to Fix
- MacOS – 30GB out of 32GB being used for wired memory
Best Answer
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.