Boost C++ Libraries: Ticket #10954: boost::spirit::iterator_policies::split_std_deque memory leak on reference count https://svn.boost.org/trac10/ticket/10954 <p> The split_std_deque implementation does not free unsued memory if only one reference to it remains. This is even true when invoking clear_queue(). See attaches example for more details. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10954 Trac 1.4.3 split_std_deque Thu, 22 Jan 2015 20:22:07 GMT attachment set https://svn.boost.org/trac10/ticket/10954 https://svn.boost.org/trac10/ticket/10954 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">split_std_deque.cpp</span> </li> </ul> <p> example causing the memory leak </p> Ticket Nikita Kniazev <nok.raven@…> Sun, 10 Dec 2017 15:21:55 GMT <link>https://svn.boost.org/trac10/ticket/10954#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10954#comment:1</guid> <description> <p> I can confirm the problem. </p> <p> <code>Once the iterator count goes down to one, and the queue is no longer needed, it is cleared, freeing up memory</code> - actually both of statements found in documentation are violated: </p> <ol><li>The queue is not cleared in this case (but manual <code>clear_queue()</code> works) </li><li>Because <code>split_std_deque</code> is actually implemented on top of <code>std::vector</code> it does not return memory to system upon calling <code>clear()</code> (the <code>shrink_to_fit()</code> call appeared only on C++11) </li></ol> </description> <category>Ticket</category> </item> </channel> </rss>