Re: Valgrind Memcheck support - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Valgrind Memcheck support
Date
Msg-id CAM-w4HOo4aHsVMS22ShBGqz+jZcFyG2KuX4ftVQyomf28JsmHA@mail.gmail.com
Whole thread Raw
In response to Valgrind Memcheck support  (Noah Misch <noah@leadboat.com>)
Responses Re: Valgrind Memcheck support
Re: Valgrind Memcheck support
List pgsql-hackers

On Sun, Jun 9, 2013 at 10:25 PM, Noah Misch <noah@leadboat.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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Custom Plan node
Next
From: Tom Lane
Date:
Subject: Re: [RFC] Extend namespace of valid guc names