Seeking Guidance on Using Valgrind in PostgreSQL for Detecting Memory Leaks in Extension Code - Mailing list pgsql-hackers

From Pradeep Kumar
Subject Seeking Guidance on Using Valgrind in PostgreSQL for Detecting Memory Leaks in Extension Code
Date
Msg-id CAJ4xhPm09qvkNmmGDAjaxN+oP4dyRwdi6fXW3an4=qtGwBp8pw@mail.gmail.com
Whole thread Raw
Responses Re: Seeking Guidance on Using Valgrind in PostgreSQL for Detecting Memory Leaks in Extension Code
List pgsql-hackers
Dear Postgres Hackers,

I am writing to seek your guidance and utilization of Valgrind in PostgreSQL for detecting memory leaks in extension-related code. Recently, I have been exploring ways to improve the stability and performance of PostgreSQL extensions by addressing memory-related issues, specifically memory leaks.
I have come across Valgrind, a tool for detecting memory errors, leaks, and other memory-related problems in C/C++ programs. However, I am in need of some guidance on how to effectively use Valgrind within the context of PostgreSQL and extensions.

I request your assistance in providing insights on the following:

1. Steps for utilizing Valgrind in PostgreSQL:
   - How do I install Valgrind and integrate it with PostgreSQL?
   - Are there any specific configurations or flags that need to be set for optimal usage with PostgreSQL?

2. Techniques for detecting memory leaks in extension-related code:
   - What are the recommended approaches for exercising extension code with Valgrind?
   - Are there any specific considerations or best practices to keep in mind when analyzing Valgrind's output for memory leaks in extension code?

I would appreciate any resources, instructions, or insights you can provide regarding the above points.

Thanks and regards,
Pradeep

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Let's make PostgreSQL multi-threaded
Next
From: Magnus Hagander
Date:
Subject: Re: win32ver data in meson-built postgres.exe