| From: | Jon Erdman <jon(at)thewickedtribe(dot)net> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, noloader(at)gmail(dot)com <noloader(at)gmail(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: valgrind a background worker |
| Date: | 2023-03-16 06:38:46 |
| Message-ID: | 01010186e92475a5-7638d668-cc91-4cb0-8f8f-dd52264636af-000000@us-west-2.amazonses.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On 2/10/23 9:08 PM, Jon Erdman wrote:
> On 2/10/23 3:05 PM, Tom Lane wrote:
>> Jeffrey Walton <noloader(at)gmail(dot)com> writes:
>>> On Fri, Feb 10, 2023 at 10:04 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>> You have to valgrind the whole cluster AFAIK. Basically, start
>>>> the postmaster under valgrind with --trace-children=yes.
>>>> For leak tracking you probably also want
>>>> --leak-check=full --track-origins=yes --read-var-info=yes
>>
>>> One additional comment... the program in question and PostgreSQL
>>> should also be built with -g -O1 per
>>> https://valgrind.org/docs/manual/quick-start.html . Otherwise, there's
>>> a risk the line information will not be accurate or usable.
>>
>> Yeah. Also, you need to compile Postgres with -DUSE_VALGRIND
>> if you want valgrind to have any idea about palloc/pfree.
>
> Thanks much both of you! I'll report back how it goes ;)
FYI folks: once I got the build done properly (valgrind brew wouldn't
install on OSX) on linux, I was able to find and fix my leaks. They were
from not calling pfree on StringInfo.data.
--
Jon Erdman (aka StuckMojo)
PostgreSQL Zealot
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Dominique Devienne | 2023-03-16 08:17:59 | Re: Is the PL/pgSQL refcursor useful in a modern three-tier app? |
| Previous Message | Laurenz Albe | 2023-03-16 05:48:24 | Re: Is the PL/pgSQL refcursor useful in a modern three-tier app? |