Re: Is this a memory leak in libpqrcv_processTuples()?
| От | Neil Chen |
|---|---|
| Тема | Re: Is this a memory leak in libpqrcv_processTuples()? |
| Дата | |
| Msg-id | CAA3qoJ=1CxTu+JMH3JvO7TJtT-AD+AB2myyKypTLoptgRQx1-g@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Is this a memory leak in libpqrcv_processTuples()? ("Dewei Dai" <daidewei1970@163.com>) |
| Список | pgsql-hackers |
Hi Chao,
As you mentioned, attinmeta will be automatically freed when the memory context is destroyed. If our concern here is that repeated calls to walrcv_exec in some section of the code are causing a large number of attinmeta objects to remain unreleased(I’m not sure if anyone would use walrcv_exec to do something like this), this would seem to imply that we are repeatedly constructing identical attinmeta instances – for example:
sprintf(query, "xxx where xx = %d", index++);
res = walrcv_exec(conn, query, ...);
}
It is rare to encounter a scenario where walrcv_exec is called multiple times and each invocation uses a query with different attrs. Therefore, if this loop scenario is indeed the case, should we consider avoiding the repeated construction of tupdesc/attinmeta?
В списке pgsql-hackers по дате отправления: