Re: Valgrind - showing memory leaks? - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: Valgrind - showing memory leaks?
Date
Msg-id CAJ7c6TN3Xk9_MAuJqgtLfNZTP0bZJUWYbPkMcoFhuBwSADTM7g@mail.gmail.com
Whole thread Raw
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: disabled SSL log_like tests
Next
From: Aleksander Alekseev
Date:
Subject: Re: [PATCH] oauth: Prevent stack overflow by limiting JSON parse depth