Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 1255

db4o-doc-7.4-2.fc13.i686.rpm

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Discarding Free Space</title>
    <link rel="stylesheet" type="text/css" href="../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>Discarding Free Space</h1><div id="TOC"><div id="TOCinner"><span class="TOCtitle">Contents</span><div class="TOCcontents"><ul><li><a href ="#Advantage">Advantage</a></li><li><a href ="#Effect">Effect</a></li><li><a href ="#Alternate Strategies">Alternate Strategies</a></li></ul></li></ul></div></div></div>



<span name="cs_wiki_filter" csw_filters="net">
<p>.NET: <code>Db4oFactory.Configure().Freespace().DiscardSmallerThan(byteCount)</code></p>
</span><p>Configures the minimum size of free space slots in the database file that are to 
be reused. </p>
<p>2 extremes for byteCount value:</p>
<ul>
<li>Integer.MAX_VALUE - discard all free slots for the best possible startup time. The downside: database files will necessarily grow faster</li><li>0 - default setting, all freespace is reused. The downside: increased memory consumption and performance loss for maintenance of freespace lists in RAM&nbsp;</li>
</ul>

<a name="Advantage"></a><h2>Advantage</h2>
<p>Allows fine-tuning of performance/size relation for your environment.<br></p>
<a name="Effect"></a><h2>Effect</h2>
<p>
When objects are updated or deleted, the space previously occupied in the database file is marked as "free", so it can be reused. db4o maintains two lists in RAM, sorted by address and by size. Adjacent entries are merged. After a large number of updates or deletes have been executed, the lists can become large, causing RAM consumption and performance loss for maintenance. With this method you can specify an upper bound for the byte slot size to discard.</p>
<a name="Alternate Strategies"></a><h2>Alternate Strategies</h2>
<p>
Regular defragment will also keep the number of free space slots small. See:</p>

<span name="cs_wiki_filter" csw_filters="net">
<p>.NET: <code>Db4objetcs.Db4o.Defragment.Defragment</code></p>
</span>
<p>If defragment can be frequently run, it will also reclaim lost space and decrease the database file to the minimum size. Therefore #discardSmallerThan(maxValue) may be a good tuning mechanism for setups with frequent defragment runs.</p></div>
    </div>
    <div id="footer">
					This revision (8) was last Modified 2006-11-23T19:10:43 by Tetyana.
				</div>
  </body>
</html>