Re: Memory leaks - Mailing list pgsql-hackers

From Neil Conway
Subject Re: Memory leaks
Date
Msg-id 87n0p63vhj.fsf@mailbox.samurai.com
Whole thread Raw
In response to Re: Memory leaks  (Petru Paler <petru@paler.net>)
List pgsql-hackers
Petru Paler <petru@paler.net> writes:
> valgrind is a great tool I used -- didn't get the time to try it out on
> Postgres yet, though. Besides leaks, it also catches uninitialized
> variable access and stuff like that.

I've used Valgrind with PostgreSQL a little bit, and it's been fairly
useful (I used it to fix some memory leaks in psql and pg_dump and a
couple of uninitialized memory accesses in the backend).

If you want to use it on the backend, you'll need to stop postgres
from clobbering ARGV (as this causes valgrind problems, for some
reason) -- add '-DPS_USE_NONE -UPS_USE_CLOBBER_ARGV' to CFLAGS. I
mentioned it to the author of valgrind, but IIRC he didn't mention
any plans to change this behavior.

Cheers,

Neil

-- 
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Thinking about IN/EXISTS optimization
Next
From: Greg Copeland
Date:
Subject: Re: Memory leaks