Re: Valgrind Memcheck support

From: Greg Stark <stark(at)mit(dot)edu>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Valgrind Memcheck support
Date: 2013-09-06 20:55:09
Message-ID: CAM-w4HOo4aHsVMS22ShBGqz+jZcFyG2KuX4ftVQyomf28JsmHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jun 9, 2013 at 10:25 PM, Noah Misch <noah(at)leadboat(dot)com> wrote:

> - Test recovery, such as by running a streaming replica under Memcheck
> while
> the primary runs "make installcheck-world".
>

In general we need a lot more testing on the recovery code.

> - Memcheck has support for detecting leaks. I have not explored that
> side at
> all, always passing --leak-check=no. We could add support for freeing
> "everything" at process exit, thereby making the leak detection
> meaningful.
>

I think this is missing the type of leaks we actually care about. The way
palloc works we can be virtually certain that if we did that we wouldn't
have any leaks. All it would detect are the random one-off mallocs we know
very well are there.

The problems we've had with leaks in the past are invariably things
allocated at the "wrong" memory context. Things that can grow for every row
processed but are stored per-query or for every query processed but stored
per-sesson. To detect that will requires more of a heuristic where when a
child memory context is reset any parent context growth is logged.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-09-06 21:36:59 Re: [RFC] Extend namespace of valid guc names
Previous Message Tom Lane 2013-09-06 20:53:41 Re: Custom Plan node