14

I have a macbook pro running osx 10.9.3 with 8 GB of RAM

I use an app which monitors my RAM and displays it in the menu bar, and after copying several large files onto my mac from an external drive (totaling almost 5 GB), I only have anywhere from 250 mb to 400 mb of available RAM (the number fluctuates), usually this number is at least 3.5 GB. When I open the app, it tells me that most of the RAM (5.66 GB) is allocated to the file cache.

http://i.imgur.com/4JQfDL8.jpg

Is there any way I can get my RAM back without having to restart my computer? I would prefer if this could be done using an applescript file so I can easily run it in the future if I need to, but it's not necessary.

3 Answers 3

11

This is normal and doesn't represent a problem. People tend to think of RAM as being either occupied or free, but that isn't actually the case. A file cache is a perfect example of this.

When you copied that data from the external drive, it had to read the contents into RAM first so it could then write it to the other drive. Copying 5 gigs of data into RAM is a computationally expensive operation. Now what if you wanted to use those files you just copied? The computer is betting that you will, so it kept the copy in RAM around so that it doesn't have pay that cost again if you do.

Now here's the kicker that addresses the heart of your question: Does having 5.66 gigs of data in the file cache really only leave you with 250-400 MB of RAM available? Nope. That 5.66 GB is still free as far as the operating system is concerned. Why? Because the computer can dump that RAM in a nanosecond if it were needed for something else. It is more beneficial for you to have your RAM filled with cached copies of stuff than it is to have it sitting empty doing nothing. The smarter the operating system is about what to cache, the faster your computer is.

Even though that program is telling you the truth about how much RAM is being used, at the same time it is misrepresenting the amount of RAM you have available.

5
  • That 5.66 GB is still free as far as the operating system is concerned Why can't OSX just mark that section of memory as free? It's confusing to the average user.
    – hsym
    Sep 3, 2015 at 10:04
  • OS X does mark it as free. Activity Monitor would have reflected that. The confusion is coming from a 3rd party app that person is using, which is reporting a different number than the OS is. Neither app is wrong; They're just disagreeing with each other over their interpretation of the facts.
    – Wes Sayeed
    Sep 3, 2015 at 17:47
  • In Mavericks, the app Memory Clean reported the same Memory Used as Activity Monitor. They don't subtract the file cache when calculating used memory.
    – hsym
    Sep 4, 2015 at 0:49
  • Know what isn't free though? Having my hard disk run at full speed to fill up gigabytes worth of free memory, slowing down everything else I try to load up. Also not free: the compute time necessary to compress some contents of memory, so that yet more disk contents can be cached. (I assume this is why, with only chrome running, I have 600mb compressed memory.) My six year old, fairly low specced macbook has run like a dog since upgrading to a version of OSX with file caching, and I suspect that this is why.
    – Pathogen
    Jun 21, 2016 at 5:56
  • I may be mistaken but file caching is probably not something recently added to OS X. OS X is based on FreeBSD, which is essentially a form of Unix, and one thing most, if not all variants of Unix have in common is file caching.
    – yitwail
    Sep 13, 2016 at 3:44
16

Open up the terminal application and activity monitor. In terminal, run

purge

It will say it is not able to perform the command, thats normal. Now run

sudo purge

Your computer might prompt you would want about using sudo commands. Not sure your level of computer skill but sudo commands if used wrong or entered improperly can seriously mess with your entire operating system.

Your file cache should be cleared if you check your activity monitor it should show the reduction in RAM usage on your Mac.

0

Use Diskinventory X to find files and folders that are taking too much space on your computer. You should see the " file cache" folder and be able to delete it.

1
  • Please read the question again carefully. Your answer does not answer the original question. The file cache referred to in the question is a memory cache not a folder on disk.
    – DavidPostill
    Apr 29, 2016 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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