Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Automatically reclaim memory from leaky programs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automatically reclaim memory from leaky programs
Authored by: timrichardson on Apr 12, '12 04:29:49AM

man purge tells you that it clears the disk cache to approximate conditions of a cold boot. Ie, before you hit the disk for anything. If you really like purge, you can make its benefits permanent.
1) Open your mac
2) remove one of the memory modules
This works because disk cache is an OS luxury: using spare RAM to improve performance. Get rid of the spare RAM, and you'll reduce the size of disk cache.

Disk is slow. RAM is fast. That's what a disk cache is. It uses some RAM to avoid going back to the slow disk.
Apple has a long track record of OS X kernels for desktop and server use, and BSD is a very mature platform. If you purge the disk cache, the OS will just fill it again because it's the smart thing to do.
The disk cache has nothing to do with leaking memory.
Leaking memory is a problem which can not be fixed except by terminating the offending process (or fixing the bug in the software). Leaking memory is when a program allocates space to an object, and doesn't reclaim it when the object is destroyed. Then it creates the object again, grabbing more memory. If this process repeats, memory leak. The OS has no idea this is happening, and there is no terminal command that can fix it.

I get days of uptime on my mac using a variety of typical software, and I don't believe memory leaks are a problem.

[ Reply to This | # ]