Boost C++ Libraries: Ticket #2696: max_size for boost pool https://svn.boost.org/trac10/ticket/2696 <p> The malloc_needs_resize, ordered_malloc_needs_resize and ordered_malloc members of the pool class double the size of the chunk requested from the operating system every time they cannot satisfy request. </p> <p> Consider a scenario in which the client allocates about 900Mb before releases the initial size of the pool is 128Mb. on the 1st request from the client the pool will request 128 MB from the OS when the client uses 128M -&gt; 256MB will be requested from the os when the client uses 384M -&gt; 512MB will be requested from the os when the client uses 896M -&gt; 1GB will be requested from the os (which is already likely to fail) </p> <p> when the client reaches 900M the pool will have close to 2Gb memory allocated from the OS. </p> <p> But the client will be perfectly happy if the pool just allocates 128M from the OS when it is exhausted, provided 128Mb is large enough to satisfy any single request from the client. </p> <p> The supplied patch allow for a cap on the chunks the pool is allocating from the OS. This is done by adding a default last parameter max_size which when left at the default of 0 leads to the uncapped behavior. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2696 Trac 1.4.3 Nikolay Mladenov Thu, 29 Jan 2009 16:06:56 GMT attachment set https://svn.boost.org/trac10/ticket/2696 https://svn.boost.org/trac10/ticket/2696 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">pool.patch</span> </li> </ul> Ticket Steven Watanabe Thu, 29 Jan 2009 19:30:15 GMT component changed; owner set https://svn.boost.org/trac10/ticket/2696#comment:1 https://svn.boost.org/trac10/ticket/2696#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Chris Newbold</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">pool</span> </li> </ul> Ticket Dean Michael Berris Mon, 29 Nov 2010 03:11:31 GMT attachment set https://svn.boost.org/trac10/ticket/2696 https://svn.boost.org/trac10/ticket/2696 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-pool-maxsize-patch-issue2696.diff</span> </li> </ul> <p> Update to original patch to apply to <a class="changeset" href="https://svn.boost.org/trac10/changeset/66834" title="Forget a ')'. ">r66834</a> -- tested locally without failures, GCC 4.4 Linux. </p> Ticket John Maddock Fri, 07 Jan 2011 11:18:46 GMT cc set https://svn.boost.org/trac10/ticket/2696#comment:2 https://svn.boost.org/trac10/ticket/2696#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">john@…</span> added </li> </ul> <p> Note to all: </p> <p> Marshall Clow plans to apply this to Trunk (and then release) to make sure it gets into 1.46. We still need a test case for this though... </p> Ticket John Maddock Fri, 07 Jan 2011 11:19:21 GMT cc changed https://svn.boost.org/trac10/ticket/2696#comment:3 https://svn.boost.org/trac10/ticket/2696#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">boostpool@…</span> added; <span class="trac-author">john@…</span> removed </li> </ul> Ticket Marshall Clow Fri, 07 Jan 2011 15:58:06 GMT <link>https://svn.boost.org/trac10/ticket/2696#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2696#comment:4</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/67752" title="Applied patch; refs #2696">[67752]</a>) Applied patch; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2696" title="#2696: Bugs: max_size for boost pool (closed: fixed)">#2696</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Tue, 11 Jan 2011 14:22:36 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2696#comment:5 https://svn.boost.org/trac10/ticket/2696#comment:5 <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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/67958" title="Merging fixes to release; Fixes #2696; Refs #4346; Refs #2941; Refs #386">[67958]</a>) Merging fixes to release; Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2696" title="#2696: Bugs: max_size for boost pool (closed: fixed)">#2696</a>; Refs <a class="reopened ticket" href="https://svn.boost.org/trac10/ticket/4346" title="#4346: Bugs: Boost pool's not comaptible with Microsoft memory leak detection (reopened)">#4346</a>; Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2941" title="#2941: Tasks: boost/pool/pool.hpp uses reinterpret_cast instead of static_cast (closed: fixed)">#2941</a>; Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/386" title="#386: Bugs: boost::pool_allocator breaks with vector of vectors (closed: fixed)">#386</a> </p> Ticket John Maddock Wed, 12 Jan 2011 17:38:25 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/2696#comment:6 https://svn.boost.org/trac10/ticket/2696#comment:6 <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">fixed</span> </li> </ul> <p> We should update the docs and tests for this issue - reopened for now so we don't forget :) </p> Ticket John Maddock Thu, 24 Feb 2011 12:19:52 GMT <link>https://svn.boost.org/trac10/ticket/2696#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2696#comment:7</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/69236" title="Some further more advanced fixes for issue #2696: Applies existing fix ...">[69236]</a>) Some further more advanced fixes for issue <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2696" title="#2696: Bugs: max_size for boost pool (closed: fixed)">#2696</a>: Applies existing fix to array allocation, Adds a test case, Adds a fallback mechanism, so that if allocation fails we shrink the next chunk size. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2696" title="#2696: Bugs: max_size for boost pool (closed: fixed)">#2696</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Tue, 02 Aug 2011 17:04:12 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2696#comment:8 https://svn.boost.org/trac10/ticket/2696#comment:8 <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> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/73495" title="Merge updated Pool lib from trunk. Fixes #1252. Fixes #2696. Fixes ...">[73495]</a>) Merge updated Pool lib from trunk. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1252" title="#1252: Bugs: [pool] severe overhead with unaligned sizes. (closed: fixed)">#1252</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2696" title="#2696: Bugs: max_size for boost pool (closed: fixed)">#2696</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4960" title="#4960: Bugs: boost::pool_allocator for vector of vectors exhausts memory (closed: fixed)">#4960</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5526" title="#5526: Bugs: fast_pool_allocator crash (closed: fixed)">#5526</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5568" title="#5568: Bugs: singleton_pool doesn't propagate MaxSize value to his pool (closed: fixed)">#5568</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5700" title="#5700: Bugs: warning in object_pool.hpp:56 (closed: fixed)">#5700</a>. </p> Ticket