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: vykor on Apr 11, '12 10:17:03AM

purge does not affect memory allocated via malloc (it says so right in the man page). malloc() is the primary system call used to allocate main memory to individual processes. Memory leaks, in the classic definition, is usually applied to this exact scenario: memory allocated via malloc(), but not free()'ed. The title of this piece is largely inaccurate -- purge does not reclaim memory lost via program memory leaks.

It does blow away the disk cache buffer, which for some reason does grow inordinately large on OS X. In most cases, however, this is not the appropriate solution, if the source of your memory problems is a memory leak in one of your long-running apps (I'm looking at you, Safari). It will also likely degrade system performance perceptibly until the buffer caches are rebuilt.

Edited on Apr 11, '12 10:19:53AM by vykor

[ Reply to This | # ]