1

I use the command line command purge to clean my memory for time to time when my machines running slow and i dont have the time to close down the machine, or close down key programs.

I was trying to show it to someone whos less technical, but as you can imagine the command line is very daunting, even if it is only one command.

I then came across this app on the mac app store called MEMORY CLEAN i guessed it was just a gui interface that ran a purge command, but upon running it it seems to clean the unused memory in a different way, which dosnt cause the hole system to freeze.

How does it do this ?

1
  • 2
    Memory does not get dirty and does not need cleaning. Memory cleaners just increase the amount of memory that is wasted. Think about it -- free memory has no effect on performance until it is used. So to get any benefit from a memory cleaner, the system has to take the memory it made free and make it used again. In other words, for a memory cleaner to help your system, the system must first undo the work the memory cleaner did. Duh! – David Schwartz Oct 22 '13 at 20:13
6

You do not want to "clean" your memory. This usually involves dumping the disk cache, which is very bad for system performance. The purge command is provided as a part of Apple's developer tools for debugging, testing, and dealing with specific issues that are related to performance-testing as if a system was freshly booted. This will considerably slow down your system.

In general, you want almost 0 free memory - any memory not being used by active applications should be in the "inactive" pool, which means that it's 100% available if an application needs it, but it is actively being used by the system to accelerate your harddrive.

Every time you access a file on your harddrive, if there is enough free memory, OS X (and Windows, and Linux) will copy the file into inactive memory. This way, if something tries to read the file again, it will read it from RAM and not from your harddrive, which can be several thousand times faster. There are many system files which are read very frequently, and disk caching is critical for system performance because of this.

5
  • 2
    Memory cleaners, a holdover from an ancient time when the OS needed help. Except for the programmer utility all are now placebos to make you think something happened because the circulating meme out there requires ritual worship. – Fiasco Labs Oct 22 '13 at 20:08
  • @FiascoLabs Sadly they are not just placebos. On mobile devices, they flush inactive applications from memory, and on desktop OSes they flush the disk cache. It gives a great big "free memory" number, but terrible performance. – Darth Android Oct 22 '13 at 20:31
  • Heh, so their effect got worse over time. Windows 95 was, due to a 64k stack, in need of a certain part needing flushed to not crash. Memory cleaners became a lucrative bandwagon that Windows 2000 and XP did not need. Every so often we get the big Linux Panic from the crossovers. *nix always believed that empty memory was wasted memory and with due reason. – Fiasco Labs Oct 22 '13 at 21:43
  • Is it not still relevant for programs the leak memory ? – sam Oct 31 '13 at 16:40
  • 1
    @sam This is completely unrelated to memory leaks. It has never been relevant for memory leaks, because the whole reason you can't clean those is because an application is saying that the leaked memory is still in use, and there's no way to know otherwise until that application is closed, at which point the OS automatically frees up all of the memory used by the application anyways. – Darth Android Nov 6 '13 at 20:45

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.