=?UTF-8?Q?Jon_Erdman?= <j...@thewickedtribe.net> writes: > I’m suspecting that the leak might be coming from initStringInfo(), as I see > a palloc() in there and no associated pfree() in my background worker’s code, > but looking at the elog backend code, it looks like maybe you only have to > explicitly free buf if you relocate it larger?
Usually it's more like "you need to pfree if you allocated in a long-lived memory context". elog is working in ErrorContext which it expects will be reset when the dust settles. regards, tom lane