Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

vansouza

macrumors 68000
Original poster
Mar 28, 2006
1,735
3
West Plains, MO USA Earth
What in the name of God is an iMac doing that it can eat so much memory not doing anything? I rebooted my iMac, loading no programs on my own, and went to breakfast. I got back and noticed that the used memory and gone from 580 to 1500+ megs of ram used. What was it doing on its own that it used so much memory?

Thanks... breathing again...:confused::eek::apple:
 
OS X over time will consume as much memory as it can for buffer cache as detailed here.

This is normal OS usage and will be freed if needed for other uses, but it's basically setting up buffer space for disk IO.

It's called a 'buffer cache' because it buffers the i/o data on its way to/from the disk. When an App writes data it first will be deposited into the Apps file buffer memory region and will subsequently be requested via library routines to have the kernel (the OS) copy it from the App's buffer to disk. The kernel will oblige and will copy it first to its buffer -- the file system buffer cache. If the kernel requires more room in its buffer cache it will obtain it from the free memory. When this happens the free memory value, in say the Terminal's top command, will immediately show a reduction of free memory. At some later point the kernel will copy this data (referred to has dirty buffers) to the appropriate disk location. I believe the frequency of this being done is 30 secs -- called sync-ing to disk.

As the usage of X increases with time without rebooting the kernel file system buffer cache will fill with the most needed or most frequently used data. This should help explain why some people claim that the system appears to perform better the longer they've been running X. The needed data for doing things (or maybe most of it) is now all resident in memory (the kernel's buffer cache) and doesn't need to be read from disk. This is much much faster.

As mentioned above, the kernel will expand its buffer cache on demand by using the free or unused memory in the machine. This explains that with time (could be a short period of time or a long period of time -- it depends on system usage/workload) the system appears to be using all of the available RAM per the Terminal's top command.

One other point to make is that if the kernel's buffer cache has grown to be quite large and is consuming a large percentage of the installed RAM there's no harm being done. If a new App is launched the kernel will release as much its buffer cache as needed. First it will release parts of the buffer cache that aren't 'dirty' until it figures it can honor the new App's memory demand. If by releasing all the non-dirty buffer segments it still requires more memory for the App then it will start writing the dirty segments of the buffer cache to disk and releasing their memory which in turn can be given to the new App. This stops when all the memory required by the new App is satisfied. In this manner the kernel buffer cache shrinks down in size. There's probably a minimum size to which it will shrink down to. In this case the kernel will start looking for other memory that's inactive. This could be a dormant App's memory. In this case the kernel will start to page out the dormant App's memory hoping to satisfy the new App's memory requirements. This kernel activity is called paging or swapping.
 
Atszyman - Thanks for all that detail. That must have been what the OS was doing.

The CPU meter was not doing anything strange if that helps anyone.

At least I can quit rebooting my iMac and MB... feel silly but happy noting is wrong.

Thanks to all.
 
But what was activity monitor saying? There are 4 types that AM breaks down, limiting it down to two types might be the problem.
 
i had this process called loginid or something, it ate up power on my imac (2.8ghz like you), it was a dreadful day, i felt like my imac turned into a PC. I was creating a 100GB 128bit .dmg on the 1tb time capsule that im backing up the MB and MBP on. and i was using handbrake, and along with that, some other stuff, my imac was being overloaded, and unusable, with like 8MB of ram left, and because of that single process. I want 4GB now.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.