Thread: Re: Valgrind - showing memory leaks?

Re: Valgrind - showing memory leaks?

From
Aleksander Alekseev
Date:
Hi Yasir

> I ran a postgres server with valgrind looking for memory leaks at a particular extension, but I am experiencing
somethingstrange. Here are the steps:
 
> [...]
> 5. Question:
> ----------------
> I believe that the valgrind should not report any memory leaks in such simple/common commands. What am I doing wrong
here?

Out-of-the box Valgrind is not aware of the concept of MemoryContexts
in Postgres. If nothing has changed in recent years you should open
src/include/pg_config_manual.h and make sure it has:

```
#define USE_VALGRIND
```

Then rebuild Postgres and run your tests again. Please let us know the results.

-- 
Best regards,
Aleksander Alekseev