Results 1 to 6 of 6
  1. #1

    Deckyon's Avatar
    Member Since
    Apr 06, 2011
    Location
    Louisville, KY - USA
    Posts
    1,291
    Specs:
    MBP 17" 2011, 2.3GHz Intel Quad-Core i7, 8GB RAM, MacMini 2011, 2.7GHz Intel Dual-Core i7, 8GB RAM
    Quick Tip: Regaining Stolen but Unused Memory
    Saw the tip on TAUW yesterday about opening up Terminal and typing PURGE to clear out memory that was being hogged by applications, but not actually being used by applications. Worked well, and when I gave it a shot, I regained over 3GB worth just from closing Aperture itself.

    This was great, and the tip worked well, but you have to watch the Terminal window to know when the command was finished. And if you are not one who is comfortable with Terminal, then the command would be useless. I went ahead and, by using Automater, created an APP for that.

    * Open up Automater and on the left column, choose "Utilities".
    * Then, you will want to choose "Run Shell Script" next. Double-click on it to open the box on the right where you can type in the commands.
    * Use /bin/bash for the Shell.
    * In the drop-down near the right top, "Pass Input: to stdin."
    * Here is what I put in, the 2nd line is for me to know when to command is completed. The Mac will actually speak the line, not pop up a dialog box. And, I like campy things sometimes.

    purge
    say "Memory Purge Complete."


    * Before saving, hit the Run button in the top right to test. If all goes well, you should hear the computer speak "Memory purge is complete."
    * Next, hit the menu File -> Save
    * I choose to save the application into my Application folder rather than the default "Documents"
    * Now, you can run it at any time without worrying about the Terminal window or waiting.

    Check the screenshot below. It shows my screen with it programmed.
    Attached Images Attached Images
    MBP 17" 2011, 2.3GHz Intel Quad-Core i7, 8GB RAM, AMD Radeon HD 6750M 1GB RAM
    MacMini 2011, 2.7GHz Intel Dual-Core i7, 8GB RAM, AMD Radeon HD 6630M 256MB RAM
    iPhone 5S 64GB, iPad Air 2 128 GB LTE, iPod Nano Gen6 8GB, Apple TV 3 & 2

  2. #2

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    It's important to note that the purge tool will clear up your inactive memory which may not be all that helpful. To better explain this, one needs to know what inactive memory is. Inactive memory is memory that was used by various applications. When you close an application, the memory it was using is relabeled inactive. The purpose of this is quite simple - when you attempt to reopen an application, the inactive memory for that application becomes active again. This process of "relabeling" the memory is much quicker than reallocating it and as a consequence, your application opens faster (ever notice that an application always launches faster the second time?). What's important to note though about this memory is that it can, if need be, be reallocated if you run out of free memory. In effect, it lies dormant until it's needed by either the application it was allocated to or another if you run out of free memory. Perhaps an example will make this clear.

    Let's say that you have 1GB of memory and you open an application that needs 500MB. Upon launching that application, you now have 500MB of active memory and 500MB of free memory (I realize that I excluded wired but that complicates the example). You use the application for a while and then quit it. You now have 500MB of free memory and 500MB of inactive memory. If you were to relaunch that application, the 500MB of inactive memory would be "relabeled" active memory. However, let's say you launch a second application instead of the first and it needs 700MB of memory. In this case, it would appear that you don't have enough free memory. Remember though that inactive memory can be reallocated so 200MB of that inactive memory will be reallocated automatically by the OS.

    I say all of this because the purge tool, while clearing out the inactive memory, is largely unneeded for most users. If your machine needs some of that inactive memory, it will just take it.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  3. #3

    Germany_chris's Avatar
    Member Since
    Oct 31, 2011
    Posts
    283
    why the automator script just to type purge?
    Mac Pro 4,1 (Flashed to 5,1) W3570 3.2 Quad..48GB RAM..Gainward GTX 570 "Phantom."
    MacBook Pro 5,2..2.8Ghz C2D..8GB RAM..240GB Vertex +

  4. #4

    Deckyon's Avatar
    Member Since
    Apr 06, 2011
    Location
    Louisville, KY - USA
    Posts
    1,291
    Specs:
    MBP 17" 2011, 2.3GHz Intel Quad-Core i7, 8GB RAM, MacMini 2011, 2.7GHz Intel Dual-Core i7, 8GB RAM
    I was being lazy, truthfully. I didn't want to open Terminal, just to type Purge. I have created it on my MBP, but copied it to my Mini as well. Now, I just hit the app from the dock and all is done.

    I use a ton of scripts in the Windows world to do daily redundant tasks. I am now working to do the same on the Mac side as well.
    MBP 17" 2011, 2.3GHz Intel Quad-Core i7, 8GB RAM, AMD Radeon HD 6750M 1GB RAM
    MacMini 2011, 2.7GHz Intel Dual-Core i7, 8GB RAM, AMD Radeon HD 6630M 256MB RAM
    iPhone 5S 64GB, iPad Air 2 128 GB LTE, iPod Nano Gen6 8GB, Apple TV 3 & 2

  5. #5


    Member Since
    Sep 05, 2012
    Posts
    4
    How do I know how much RAM was purged? (Excuse my ignorance, I am new at using automator).

  6. #6

    Lifeisabeach's Avatar
    Member Since
    Sep 30, 2007
    Location
    The Republic of Neptune
    Posts
    7,757
    Vansmith is spot on. Routinely purging the RAM is a placebo to treat a non-existent problem and is even counterproductive. If you have an app that is acting up and eating up RAM when it shouldn't be, then purge may need to be run, but then it'd be more prudent to find the culprit and handle it from there. This is like trying to kill a cockroach with a grenade.

    Please verify and include the exact model/year of your Mac and OS X version number (available from "About This Mac", then "More Info" on the Apple menu).
    ------
    Links: Onyx | EasyFind | Apple Hardware Test | How to test your hard drive | The Safe Mac Adware Removal Guide | Uninstall MacKeeper
    ------
    Lifeisabeach - Mac-Forums Member of the Month June 2009, Feb 2012, and March 2013.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Have a new Windows PC? Just a quick tip regarding recovery partitions
    By cwa107 in forum Other Hardware and Peripherals
    Replies: 3
    Last Post: 08-03-2012, 08:36 PM
  2. Speeding Up OSX Lion (Quick Tip That Works)
    By jdeep82 in forum OS X - Operating System
    Replies: 7
    Last Post: 05-02-2012, 07:50 AM
  3. Quick shortcut/tip...
    By Liam in forum OS X - Apps and Games
    Replies: 2
    Last Post: 11-17-2006, 10:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •