<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 8.6.8">
<title>MLtonGC</title>
<link rel="stylesheet" href="./asciidoc.css" type="text/css">
<link rel="stylesheet" href="./pygments.css" type="text/css">


<script type="text/javascript" src="./asciidoc.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install();
/*]]>*/
</script>
<link rel="stylesheet" href="./mlton.css" type="text/css"/>
</head>
<body class="article">
<div id="banner">
<div id="banner-home">
<a href="./Home">MLton 20130715</a>
</div>
</div>
<div id="header">
<h1>MLtonGC</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span class="k">signature</span><span class="w"> </span><span class="n">MLTON_GC</span><span class="w"> </span><span class="p">=</span><span class="w"></span>
<span class="w">   </span><span class="k">sig</span><span class="w"></span>
<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">collect</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="w"></span>
<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">pack</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="w"></span>
<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">setMessages</span><span class="p">:</span><span class="w"> </span><span class="n">bool</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="w"></span>
<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">setSummary</span><span class="p">:</span><span class="w"> </span><span class="n">bool</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="w"></span>
<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">unpack</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Statistics</span><span class="w"> </span><span class="p">:</span><span class="w"></span>
<span class="w">         </span><span class="k">sig</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">bytesAllocated</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">IntInf</span><span class="p">.</span><span class="n">int</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">lastBytesLive</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">IntInf</span><span class="p">.</span><span class="n">int</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">numCopyingGCs</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">IntInf</span><span class="p">.</span><span class="n">int</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">numMarkCompactGCs</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">IntInf</span><span class="p">.</span><span class="n">int</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">numMinorGCs</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">IntInf</span><span class="p">.</span><span class="n">int</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">maxBytesLive</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">IntInf</span><span class="p">.</span><span class="n">int</span><span class="w"></span>
<span class="w">         </span><span class="k">end</span><span class="w"></span>
<span class="w">   </span><span class="k">end</span><span class="w"></span>
</pre></div></div></div>
<div class="ulist"><ul>
<li>
<p>
<span class="monospaced">collect ()</span>
</p>
<div class="paragraph"><p>causes a garbage collection to occur.</p></div>
</li>
<li>
<p>
<span class="monospaced">pack ()</span>
</p>
<div class="paragraph"><p>shrinks the heap as much as possible so that other processes can use
available RAM.</p></div>
</li>
<li>
<p>
<span class="monospaced">setMessages b</span>
</p>
<div class="paragraph"><p>controls whether diagnostic messages are printed at the beginning and
end of each garbage collection.  It is the same as the <span class="monospaced">gc-messages</span>
runtime system option.</p></div>
</li>
<li>
<p>
<span class="monospaced">setSummary b</span>
</p>
<div class="paragraph"><p>controls whether a summary of garbage collection statistics is printed
upon termination of the program.  It is the same as the <span class="monospaced">gc-summary</span>
runtime system option.</p></div>
</li>
<li>
<p>
<span class="monospaced">unpack ()</span>
</p>
<div class="paragraph"><p>resizes a packed heap to the size desired by the runtime.</p></div>
</li>
<li>
<p>
<span class="monospaced">Statistics.bytesAllocated ()</span>
</p>
<div class="paragraph"><p>returns bytes allocated (as of the most recent garbage collection).</p></div>
</li>
<li>
<p>
<span class="monospaced">Statistics.lastBytesLive ()</span>
</p>
<div class="paragraph"><p>returns bytes live (as of the most recent garbage collection).</p></div>
</li>
<li>
<p>
<span class="monospaced">Statistics.numCopyingGCs ()</span>
</p>
<div class="paragraph"><p>returns number of (major) copying garbage collections performed (as of
the most recent garbage collection).</p></div>
</li>
<li>
<p>
<span class="monospaced">Statistics.numMarkCompactGCs ()</span>
</p>
<div class="paragraph"><p>returns number of (major) mark-compact garbage collections performed
(as of the most recent garbage collection).</p></div>
</li>
<li>
<p>
<span class="monospaced">Statistics.numMinorGCs ()</span>
</p>
<div class="paragraph"><p>returns number of minor garbage collections performed (as of the most
recent garbage collection).</p></div>
</li>
<li>
<p>
<span class="monospaced">Statistics.maxBytesLive ()</span>
</p>
<div class="paragraph"><p>returns maximum bytes live (as of the most recent garbage collection).</p></div>
</li>
</ul></div>
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
</div>
<div id="footer-badges">
</div>
</div>
</body>
</html>
