New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

Quick Tip: Regaining Stolen but Unused Memory


Post Reply New Thread Subscribe

 
Thread Tools
Deckyon

 
Deckyon's Avatar
 
Member Since: Apr 06, 2011
Location: Louisville, KY - USA
Posts: 1,287
Deckyon is just really niceDeckyon is just really niceDeckyon is just really niceDeckyon is just really niceDeckyon is just really nice
Mac Specs: MBP 17" 2011, 2.3GHz Intel Quad-Core i7, 8GB RAM, MacMini 2011, 2.7GHz Intel Dual-Core i7, 8GB RAM

Deckyon is offline
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
File Type: jpg image.jpg (109.6 KB, 40 views)

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 Gen3 32GB WiFi, iPod Nano Gen6 8GB, Apple TV 3 & 2
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,767
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is online now
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
QUOTE Thanks
Germany_chris

 
Germany_chris's Avatar
 
Member Since: Oct 31, 2011
Posts: 280
Germany_chris has a spectacular aura about

Germany_chris is offline
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 +
QUOTE Thanks
Deckyon

 
Deckyon's Avatar
 
Member Since: Apr 06, 2011
Location: Louisville, KY - USA
Posts: 1,287
Deckyon is just really niceDeckyon is just really niceDeckyon is just really niceDeckyon is just really niceDeckyon is just really nice
Mac Specs: MBP 17" 2011, 2.3GHz Intel Quad-Core i7, 8GB RAM, MacMini 2011, 2.7GHz Intel Dual-Core i7, 8GB RAM

Deckyon is offline
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 Gen3 32GB WiFi, iPod Nano Gen6 8GB, Apple TV 3 & 2
QUOTE Thanks
jd1012

 
Member Since: Sep 05, 2012
Posts: 2
jd1012 is on a distinguished road

jd1012 is offline
How do I know how much RAM was purged? (Excuse my ignorance, I am new at using automator).
QUOTE Thanks
Lifeisabeach

 
Lifeisabeach's Avatar
 
Member Since: Sep 30, 2007
Location: Wilmington, NC
Posts: 6,892
Lifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond repute
Mac Specs: iMac i3 (mid-2010) + OS 10.9; TV 3; iPhone 5S; iPad 4

Lifeisabeach is offline
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.
QUOTE Thanks

Post Reply New Thread Subscribe


« Formatting Flash Drive? | saving images from web »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Quick question about memory.. rift0065 Apple Notebooks 3 07-02-2007 07:26 AM
Quick memory question Pigchops Apple Desktops 2 05-12-2007 03:50 PM
Small, Fast Web Browsers - Quick Roundup mac57 OS X - Apps and Games 1 01-03-2007 08:20 AM
Mac Mini and memory upgrades? Quick Q's VakeJ Apple Desktops 7 01-25-2005 08:39 PM
Memory question..help quick TheCubedXbox Apple Desktops 1 12-27-2004 01:49 PM

All times are GMT -4. The time now is 09:17 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?