Re: Curing plpgsql's memory leaks for statement-lifespan values
От | Dilip Kumar |
---|---|
Тема | Re: Curing plpgsql's memory leaks for statement-lifespan values |
Дата | |
Msg-id | CAFiTN-uLBa3KOUUXGGWn9rxXgkc0MkBCJ4jKeon7p84+qEqw2A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Curing plpgsql's memory leaks for statement-lifespan values (Amit Kapila <amit.kapila16@gmail.com>) |
Список | pgsql-hackers |
<div dir="ltr"><div class="gmail_extra"><br /><div class="gmail_quote">On Sun, Jul 24, 2016 at 12:40 PM, Amit Kapila <spandir="ltr"><<a href="mailto:amit.kapila16@gmail.com" target="_blank">amit.kapila16@gmail.com</a>></span> wrote:<br/><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><divclass="" id=":5jg">Inshort, why do you think<br /> it is better to create a new context rather than using "SPI Exec"?<div class=""><divclass="" id=":42q" tabindex="0"></div></div></div></blockquote></div><br />I think life span of the memory allocatedfrom <span style="font-size:12.8px">"SPI Exec" is only within "Executor", and after that SPI_Exec</span></div><divclass="gmail_extra"><span style="font-size:12.8px">will be reset. But many places we need such memorybeyond "Executor"</span><span style="font-size:12.8px">(including one which is reported in above issue).</span></div><divclass="gmail_extra"><span style="font-size:12.8px"><br /></span></div><div class="gmail_extra"><spanstyle="font-size:12.8px">If we see below example of </span>exec_stmt_dynexecute.</div><div class="gmail_extra">exec_stmt_dynexecute<br/></div><div class="gmail_extra"><p class="">{<p class="">....<p class=""><p class="">querystr= pstrdup(querystr);<p class="">SPI_Execute --> inside this SPI_Exec context will be reset.<p class="">Afterthis querystr is being used in this function.<p class="">}</div><div class="gmail_extra">-- <br /><div class="gmail_signature"data-smartmail="gmail_signature"><div dir="ltr"><span style="color:rgb(80,0,80);font-size:12.8px">Regards,</span><brstyle="color:rgb(80,0,80);font-size:12.8px" /><span style="color:rgb(80,0,80);font-size:12.8px">DilipKumar</span><br style="color:rgb(80,0,80);font-size:12.8px" /><span style="color:rgb(80,0,80);font-size:12.8px">EnterpriseDB: </span><ahref="http://www.enterprisedb.com/" style="color:rgb(17,85,204);font-size:12.8px"target="_blank">http://www.enterprisedb.com</a><br /></div></div></div></div>
В списке pgsql-hackers по дате отправления: