Empty RAM and disk cache on Mac with one click

Every time an app is launched, it processes data that is loaded onto RAM and disk cache so that it can get to the CPU faster.
When you close that application, the occupied RAM and cache are freed and made available to other apps.
Every computer has a limit in the ability to process data and to run programs or applications which is given by its amount of RAM.
Even if Macs are powerful beautiful computers it is inevitable that opening different applications together can create some kind of slowdown due to the memory that is almost completely occupied.
The problem is that that mechanism of freeing up RAM when closing an app is not always fully efficient.
This goes for a Mac, a PC and any smartphone and is very tangible when you leave your PC or mobile phone on for several days, which becomes slower and slower until a restart is required.
Sometimes applications leave their data in memory leaving less and less available for other programs.
When you feel like your Mac is slower, there is a command to empty all the occupied RAM and disk cache on the Mac with a simple single command called Purge .
NOTE: to check the status of the RAM memory occupied on Mac, open the Launchpad, go to Activity Monitor and check the Memory section.
Keeping the activity monitor open, close all open applications on the Mac (if you want you can create a button for this using the Automator utility from the Launchpad, going to Workflow, then selecting Utilities and, finally, Exit all apps ).
Start Terminal on the Mac, type the following command and press Enter:
sudo purge
You will then be asked to enter the administrator password before starting the operation.
When the command has done its job, there will be no confirmation message, but you will notice the difference in memory occupied in activity monitoring.
All the data cached on the disk and on the RAM should have been removed and all the space becomes free, empty and available for other applications.
If you want to do this faster in the future, you can create a Purge launcher icon to use with one click, without having to use the Terminal again.
Start Automator from the Launchpad, select the Applications folder in the left panel and click on " New document " to create a new service .
In the following screen choose service and then click on "Choose" to create the service.
Drag the action named " Run AppleScript " from the Actions pane on the left and drop it onto the workflow on the right.
Type the following script into the AppleScript box:
tell current application
activate
do shell script "sudo purge" with administrator privileges
end tell
Save the service from the " File " menu at the top giving it a name such as " Empty memory ".
The command can now be executed from any application by clicking on its name at the top, going to Services .
If you want something nicer and even less difficult to use to empty RAM on Mac, you can install the Memory Clean app for Mac which shows the occupied memory and allows you to free it with a click on the program button.
READ ALSO: Speed ​​up Mac OS X and avoid slowdowns even if old

Leave Your Comment

Please enter your comment!
Please enter your name here