Andres Freund <andres(at)anarazel(dot)de> writes: > I saw a leak in pgstat_read_statsfiles(), more precisely: > /* Allocate the space for replication slot statistics */ > replSlotStats = palloc0(max_replication_slots * sizeof(PgStat_ReplSlotStats));
Yeah, I just found that myself. I think your fix is good.
> But it seems like we just shouldn't allocate it dynamically at all? > max_replication_slots doesn't change during postmaster lifetime, so it > seems like it should just be allocated once?
Meh. I don't see a need to wire in such an assumption here.