From PostgreSQL wiki

Revision as of 03:24, 29 October 2013 by Tgl (Talk | contribs)

Jump to: navigation, search

Valgrind and Postgres

Postgres 9.4 supports Valgrind directly - it is possible to include "client requests" in the memory allocator, providing detection of many additional memory others that would otherwise not be detected in vanilla builds. See src/include/pg_config_manual.h for full details of how to build Postgres with support for Valgrind memcheck instrumentation.

You should normally use MEMORY_CONTEXT_CHECKING with USE_VALGRIND; instrumentation of repalloc() is inferior without it.

Known Bugs

If you observe core dumps in autovacuum while running under Valgrind on x86_64 hardware, it's probably a known bug in valgrind 3.8.1 and earlier; see If you're prepared to recompile Valgrind, apply the one-line patch shown there. Otherwise, the simplest answer is to set autovacuum = off in postgresql.conf while using Valgrind. However, it's not clear that that "fix" will hide all instances of the issue.

Personal tools