Boost C++ Libraries: Ticket #8526: coroutine memory leak https://svn.boost.org/trac10/ticket/8526 <p> hi i'm Seunghyun </p> <p> I prediect there is a memory leak in coroutine library. following codes make incresing used memory. I found Caller object generated at coroutine_object&lt;&gt;::run() is not deleted. Check please. Sorry for my bad english. </p> <p> typedef boost::coroutines::coroutine&lt;void()&gt; coro_t; </p> <p> void f(coro_t::caller_type &amp;caller) { } </p> <p> void invoke() { </p> <blockquote> <p> while(true) { </p> <blockquote> <p> coro_t co(&amp;f); </p> </blockquote> <p> } </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8526 Trac 1.4.3 olli Tue, 30 Apr 2013 08:52:39 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8526#comment:1 https://svn.boost.org/trac10/ticket/8526#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> the caller is allocated on the stack of the calling coroutine - the destructor will not be called but the stack (memory) is released or reused after the calling coroutine is destroyed - so it is not a memory leak. </p> Ticket olli Wed, 01 May 2013 08:11:23 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/8526#comment:2 https://svn.boost.org/trac10/ticket/8526#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">invalid</span> </li> </ul> Ticket olli Wed, 01 May 2013 09:27:29 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8526#comment:3 https://svn.boost.org/trac10/ticket/8526#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket rivercheng@… Fri, 31 May 2013 04:31:38 GMT <link>https://svn.boost.org/trac10/ticket/8526#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8526#comment:4</guid> <description> <p> Hi, Oliver Could you please explain how this bug is fixed? It exists in 1.53 release and I want to know whether I can make a small change to existing codes to fix this problem instead of waiting for another release. Thanks a lot. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Fri, 31 May 2013 06:18:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8526#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8526#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/8526#comment:4" title="Comment 4">rivercheng@…</a>: </p> <blockquote class="citation"> <p> Hi, Oliver Could you please explain how this bug is fixed? It exists in 1.53 release and I want to know whether I can make a small change to existing codes to fix this problem instead of waiting for another release. Thanks a lot. </p> </blockquote> <blockquote> <p> void run() { </p> <blockquote> <p> ... { </p> <blockquote> <p> Caller c( this-&gt;caller_, false, this-&gt;preserve_fpu(), alloc_); fn_( c); ... </p> </blockquote> <p> } ... </p> </blockquote> <p> } </p> </blockquote> <p> If coroutine is unwinded fn_() throw unwind-excpetion and Caller ist automatically destructed. </p> </description> <category>Ticket</category> </item> </channel> </rss>