Memory Leak Utility

Kurt Wall kwall
Fri Jun 22 20:36:49 PDT 2007


On Jun 22, 2007, at 11:01 PM, Shawn wrote:

> Hi guys,
>
> i believe I may have found a memory leak in the psql app under
> PostgreSQL 8.2.4 that was not there in 8.2.3.   But I'd like to be a
> bit more certain of my facts.  Is there a utility available to look at
> memory usage and perhaps ways to free up memory in a leak type
> situation, short of a reboot of course?
>
> Slackware 11.0 with updates.  Postgres compiled from source.

You can use Electric Fence to detect most memory errors, but I  
believe what you'll have the most luck using is valgrind. It's really  
difficult to "free up memory leaks" because of how they occur: an  
application allocates memory and then fails to free it, usually by  
destroying the reference. Without that reference (pointer) to the  
starting address of the allocated memory, there's no way for a  
utility to access the memory. Killing the parent process *might*  
allow the kernel to reclaim the memory.

What makes you think it's leaking memory?

Kurt




More information about the Linux-users mailing list