Re: [PATCH] Fix memory leak in pgstat_progress_parallel_incr_param() - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: [PATCH] Fix memory leak in pgstat_progress_parallel_incr_param()
Date
Msg-id CAA5RZ0sb06bJecz1=0GtM69hO9HarCD_1+m0YOmyZ_PpEs_M6Q@mail.gmail.com
Whole thread
In response to Re: [PATCH] Fix memory leak in pgstat_progress_parallel_incr_param()  (Baji Shaik <baji.pgdev@gmail.com>)
Responses Re: [PATCH] Fix memory leak in pgstat_progress_parallel_incr_param()
List pgsql-hackers
Hi,

good find, and thanks for the patches!

>   0001: drop the redundant initStringInfo() call (backport candidate)

This one looks like an obvious fix to me.

>   0002: allocate the static buffer once per process via
>         pq_beginmessage_reuse / pq_endmessage_reuse, to avoid the
>         per-call allocation (master only)

I am less convinced this will have any benefits for the additional complexity.
The callers of pgstat_progress_parallel_incr_param() are not frequent enough
to make a measurable difference here. cost delay reporting for parallel workers
is throttled by PARALLEL_VACUUM_DELAY_REPORT_INTERVAL_NS and
index progress reporting does not happen very frequently either.

--
Sami Imseih
Amazon Web Services (AWS)



pgsql-hackers by date:

Previous
From: Xuneng Zhou
Date:
Subject: Re: Fix race in ReplicationSlotRelease for ephemeral slots
Next
From: Baji Shaik
Date:
Subject: Re: [PATCH] Fix memory leak in pgstat_progress_parallel_incr_param()