Sophie

Sophie

distrib > Fedora > 17 > i386 > by-pkgid > 675c8c8167236dfcf8d66da674f931e8 > files > 1240

erlang-doc-R15B-03.3.fc17.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:fn="http://www.w3.org/2005/02/xpath-functions">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../doc/otp_doc.css" type="text/css">
<title>Erlang -- erts_alloc_config</title>
</head>
<body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000"><div id="container">
<script id="js" type="text/javascript" language="JavaScript" src="../../../../doc/js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../../../../doc/js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript">
            <!--
              function getWinHeight() {
                var myHeight = 0;
                if( typeof( window.innerHeight ) == 'number' ) {
                  //Non-IE
                  myHeight = window.innerHeight;
                } else if( document.documentElement && ( document.documentElement.clientWidth ||
                                                         document.documentElement.clientHeight ) ) {
                  //IE 6+ in 'standards compliant mode'
                  myHeight = document.documentElement.clientHeight;
                } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                  //IE 4 compatible
                  myHeight = document.body.clientHeight;
                }
                return myHeight;
              }

              function setscrollpos() {
                var objf=document.getElementById('loadscrollpos');
                 document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2;
              }

              function addEvent(obj, evType, fn){
                if (obj.addEventListener){
                obj.addEventListener(evType, fn, true);
                return true;
              } else if (obj.attachEvent){
                var r = obj.attachEvent("on"+evType, fn);
                return r;
              } else {
                return false;
              }
             }

             addEvent(window, 'load', setscrollpos);

             //--></script><div id="leftnav"><div class="innertube">
<img alt="Erlang logo" src="../../../../doc/erlang-logo.png"><br><small><a href="index.html">Reference Manual</a><br><a href="release_notes.html">Release Notes</a><br><a href="../pdf/runtime_tools-1.8.9.pdf">PDF</a><br><a href="../../../../doc/index.html">Top</a></small><p><strong>Runtime_Tools</strong><br><strong>Reference Manual</strong><br><small>Version 1.8.9</small></p>
<br><a href="javascript:openAllFlips()">Expand All</a><br><a href="javascript:closeAllFlips()">Contract All</a><p><small><strong>Table of Contents</strong></small></p>
<ul class="flipMenu">
<li title="runtime_tools (App)"><a href="runtime_tools_app.html">runtime_tools (App)
                </a></li>
<li id="no" title="dbg " expanded="false">dbg<ul>
<li><a href="dbg.html">
                  Top of manual page
                </a></li>
<li title="fun2ms-1"><a href="dbg.html#fun2ms-1">fun2ms/1</a></li>
<li title="h-0"><a href="dbg.html#h-0">h/0</a></li>
<li title="h-1"><a href="dbg.html#h-1">h/1</a></li>
<li title="p-1"><a href="dbg.html#p-1">p/1</a></li>
<li title="p-2"><a href="dbg.html#p-2">p/2</a></li>
<li title="c-3"><a href="dbg.html#c-3">c/3</a></li>
<li title="c-4"><a href="dbg.html#c-4">c/4</a></li>
<li title="i-0"><a href="dbg.html#i-0">i/0</a></li>
<li title="tp-2"><a href="dbg.html#tp-2">tp/2</a></li>
<li title="tp-3"><a href="dbg.html#tp-3">tp/3</a></li>
<li title="tp-4"><a href="dbg.html#tp-4">tp/4</a></li>
<li title="tp-2"><a href="dbg.html#tp-2">tp/2</a></li>
<li title="tpl-2"><a href="dbg.html#tpl-2">tpl/2</a></li>
<li title="tpl-3"><a href="dbg.html#tpl-3">tpl/3</a></li>
<li title="tpl-4"><a href="dbg.html#tpl-4">tpl/4</a></li>
<li title="tpl-2"><a href="dbg.html#tpl-2">tpl/2</a></li>
<li title="ctp-0"><a href="dbg.html#ctp-0">ctp/0</a></li>
<li title="ctp-1"><a href="dbg.html#ctp-1">ctp/1</a></li>
<li title="ctp-2"><a href="dbg.html#ctp-2">ctp/2</a></li>
<li title="ctp-3"><a href="dbg.html#ctp-3">ctp/3</a></li>
<li title="ctp-1"><a href="dbg.html#ctp-1">ctp/1</a></li>
<li title="ctpl-0"><a href="dbg.html#ctpl-0">ctpl/0</a></li>
<li title="ctpl-1"><a href="dbg.html#ctpl-1">ctpl/1</a></li>
<li title="ctpl-2"><a href="dbg.html#ctpl-2">ctpl/2</a></li>
<li title="ctpl-3"><a href="dbg.html#ctpl-3">ctpl/3</a></li>
<li title="ctpl-1"><a href="dbg.html#ctpl-1">ctpl/1</a></li>
<li title="ctpg-0"><a href="dbg.html#ctpg-0">ctpg/0</a></li>
<li title="ctpg-1"><a href="dbg.html#ctpg-1">ctpg/1</a></li>
<li title="ctpg-2"><a href="dbg.html#ctpg-2">ctpg/2</a></li>
<li title="ctpg-3"><a href="dbg.html#ctpg-3">ctpg/3</a></li>
<li title="ctpg-1"><a href="dbg.html#ctpg-1">ctpg/1</a></li>
<li title="ltp-0"><a href="dbg.html#ltp-0">ltp/0</a></li>
<li title="dtp-0"><a href="dbg.html#dtp-0">dtp/0</a></li>
<li title="dtp-1"><a href="dbg.html#dtp-1">dtp/1</a></li>
<li title="wtp-1"><a href="dbg.html#wtp-1">wtp/1</a></li>
<li title="rtp-1"><a href="dbg.html#rtp-1">rtp/1</a></li>
<li title="n-1"><a href="dbg.html#n-1">n/1</a></li>
<li title="cn-1"><a href="dbg.html#cn-1">cn/1</a></li>
<li title="ln-0"><a href="dbg.html#ln-0">ln/0</a></li>
<li title="tracer-0"><a href="dbg.html#tracer-0">tracer/0</a></li>
<li title="tracer-2"><a href="dbg.html#tracer-2">tracer/2</a></li>
<li title="tracer-3"><a href="dbg.html#tracer-3">tracer/3</a></li>
<li title="trace_port-2"><a href="dbg.html#trace_port-2">trace_port/2</a></li>
<li title="flush_trace_port-0"><a href="dbg.html#flush_trace_port-0">flush_trace_port/0</a></li>
<li title="flush_trace_port-1"><a href="dbg.html#flush_trace_port-1">flush_trace_port/1</a></li>
<li title="trace_port_control-1"><a href="dbg.html#trace_port_control-1">trace_port_control/1</a></li>
<li title="trace_port_control-2"><a href="dbg.html#trace_port_control-2">trace_port_control/2</a></li>
<li title="trace_client-2"><a href="dbg.html#trace_client-2">trace_client/2</a></li>
<li title="trace_client-3"><a href="dbg.html#trace_client-3">trace_client/3</a></li>
<li title="stop_trace_client-1"><a href="dbg.html#stop_trace_client-1">stop_trace_client/1</a></li>
<li title="get_tracer-0"><a href="dbg.html#get_tracer-0">get_tracer/0</a></li>
<li title="get_tracer-1"><a href="dbg.html#get_tracer-1">get_tracer/1</a></li>
<li title="stop-0"><a href="dbg.html#stop-0">stop/0</a></li>
<li title="stop_clear-0"><a href="dbg.html#stop_clear-0">stop_clear/0</a></li>
</ul>
</li>
<li id="no" title="dyntrace " expanded="false">dyntrace<ul>
<li><a href="dyntrace.html">
                  Top of manual page
                </a></li>
<li title="available-0"><a href="dyntrace.html#available-0">available/0</a></li>
<li title="p-0"><a href="dyntrace.html#p-0">p/0</a></li>
<li title="p-1"><a href="dyntrace.html#p-1">p/1</a></li>
<li title="p-2"><a href="dyntrace.html#p-2">p/2</a></li>
<li title="p-3"><a href="dyntrace.html#p-3">p/3</a></li>
<li title="p-4"><a href="dyntrace.html#p-4">p/4</a></li>
<li title="p-5"><a href="dyntrace.html#p-5">p/5</a></li>
<li title="p-6"><a href="dyntrace.html#p-6">p/6</a></li>
<li title="p-7"><a href="dyntrace.html#p-7">p/7</a></li>
<li title="p-8"><a href="dyntrace.html#p-8">p/8</a></li>
<li title="get_tag-0"><a href="dyntrace.html#get_tag-0">get_tag/0</a></li>
<li title="get_tag-0"><a href="dyntrace.html#get_tag-0">get_tag/0</a></li>
<li title="put_tag-1"><a href="dyntrace.html#put_tag-1">put_tag/1</a></li>
<li title="spread_tag-1"><a href="dyntrace.html#spread_tag-1">spread_tag/1</a></li>
<li title="restore_tag-1"><a href="dyntrace.html#restore_tag-1">restore_tag/1</a></li>
</ul>
</li>
<li id="loadscrollpos" title="erts_alloc_config " expanded="true">erts_alloc_config<ul>
<li><a href="erts_alloc_config.html">
                  Top of manual page
                </a></li>
<li title="save_scenario-0"><a href="erts_alloc_config.html#save_scenario-0">save_scenario/0</a></li>
<li title="make_config-0"><a href="erts_alloc_config.html#make_config-0">make_config/0</a></li>
<li title="make_config-1"><a href="erts_alloc_config.html#make_config-1">make_config/1</a></li>
<li title="stop-0"><a href="erts_alloc_config.html#stop-0">stop/0</a></li>
</ul>
</li>
</ul>
</div></div>
<div id="content">
<div class="innertube">
<!-- refpage --><center><h1>erts_alloc_config</h1></center>
  
  <h3>MODULE</h3>
<div class="REFBODY">erts_alloc_config</div>
  <h3>MODULE SUMMARY</h3>
<div class="REFBODY">Configuration tool for erts_alloc</div>
  <h3>DESCRIPTION</h3>
<div class="REFBODY"><p>
    <div class="note">
<div class="label">Note</div>
<div class="content"><p>
      <p><span class="code">erts_alloc_config</span> is currently an experimental
        tool and might be subject to backward incompatible
        changes.</p>
    </p></div>
</div>
    <p><span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','erts','erts_alloc.html');">erts_alloc(3)</a></span> is an
      Erlang Run-Time System internal memory allocator library.
      <span class="code">erts_alloc_config</span> is intended to be used to aid creation
      of an <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','erts','erts_alloc.html');">erts_alloc(3)</a></span>
      configuration that is suitable for a limited number of runtime
      scenarios. The configuration that <span class="code">erts_alloc_config</span>
      produce is intended as a suggestion, and may need to be
      adjusted manually.</p>
    <p>The configuration is created based on information about a number
      of runtime scenarios. It is obviously impossible to foresee every
      runtime scenario that can occur. The important scenarios are
      those that cause maximum or minimum load on specific memory
      allocators. Load in this context is total size of memory blocks
      allocated.</p>
    <p>The current implementation of <span class="code">erts_alloc_config</span> concentrate
      on configuration of multi-block carriers. Information gathered
      when a runtime scenario is saved is mainly current and maximum use
      of multi-block carriers. If a parameter that change the use of
      multi-block carriers is changed, a previously generated
      configuration is invalid and <span class="code">erts_alloc_config</span> needs
      to be run again. It is mainly the single block carrier threshold
      that effects the use of multi-block carriers, but other
      single-block carrier parameters might as well. If another value of
      a single block carrier parameter than the default is desired, use
      the desired value when running <span class="code">erts_alloc_config</span>.</p>
    <p>A configuration is created in the following way:</p>
    <ul>
      <li>
        <p>Pass the <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','erts','erts_alloc.html#Mea');">+Mea config</a></span>
	   command-line flag to the Erlang runtime system you are going
	   to use for creation of the allocator configuration. It will
	   disable features that prevent <span class="code">erts_alloc_config</span> from
	   doing its job. Note, you should <strong>not</strong> use this flag
	   when using the created configuration. Also note that it is
	   important that you use the same
	   <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','erts','erl.html#+S');">amount of schedulers</a></span>
	   when creating the configuration as you are going the use on
	   the system using the configuration.</p>
      </li>
      <li>
        <p>Run your applications with different scenarios (the more
          the better) and save information about each scenario by calling
          <span class="bold_code"><a href="#save_scenario-0">save_scenario/0</a></span>.
          It may be hard to know when the applications are at an (for
          <span class="code">erts_alloc_config</span>) important runtime scenario. A good
          approach may therefore be to call
          <span class="bold_code"><a href="#save_scenario-0">save_scenario/0</a></span>
          repeatedly, e.g. once every tenth second. Note that it is
          important that your applications reach the runtime scenarios
          that are important for <span class="code">erts_alloc_config</span> when you are
          saving scenarios; otherwise, the configuration may perform
          bad.</p>
      </li>
      <li>
        <p>When you have covered all scenarios, call
          <span class="bold_code"><a href="#make_config-1">make_config/1</a></span>
          in order to create a configuration. The configuration is
          written to a file that you have chosen. This configuration
          file can later be read by an Erlang runtime-system at
          startup. Pass the command line argument 
          <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','erts','erl.html#args_file');">-args_file FileName</a></span>
          to the <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','erts','erl.html');">erl(1)</a></span> command.</p>
      </li>
      <li>
        <p>The configuration produced by <span class="code">erts_alloc_config</span> may
          need to be manually adjusted as already stated. Do not modify the
          file produced by <span class="code">erts_alloc_config</span>; instead, put your
          modifications in another file and load this file after the
          file produced by <span class="code">erts_alloc_config</span>. That is, put the
          <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','erts','erl.html#args_file');">-args_file FileName</a></span>
          argument that reads your modification file later on the
          command-line than the 
          <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','erts','erl.html#args_file');">-args_file FileName</a></span>
          argument that reads the configuration file produced by
          <span class="code">erts_alloc_config</span>. If a memory allocation parameter
          appear multiple times, the last version of will be used, i.e.,
          you can override parameters in the configuration file produced
          by <span class="code">erts_alloc_config</span>. Doing it this way simplifies
          things when you want to rerun <span class="code">erts_alloc_config</span>.</p>
      </li>
    </ul>
    <div class="note">
<div class="label">Note</div>
<div class="content"><p>
      <p>The configuration created by <span class="code">erts_alloc_config</span> may
        perform bad, ever horrible, for runtime scenarios that are very
        different from the ones saved when creating the
        configuration. You are, therefore, advised to rerun
        <span class="code">erts_alloc_config</span> if the applications run when the
        configuration was made are changed, or if the load on the
        applications have changed since the configuration was made. You
        are also advised to rerun <span class="code">erts_alloc_config</span> if the Erlang
        runtime system used is changed.</p>
    </p></div>
</div>
    <p><span class="code">erts_alloc_config</span> saves information about runtime scenarios
      and performs computations in a server that is automatically
      started. The server register itself under the name
      <span class="code">'__erts_alloc_config__'</span>.</p>
  </p></div>
  <h3>EXPORTS</h3>
    <p><a name="save_scenario-0"><span class="bold_code">save_scenario() -&gt; ok | {error, Error}</span></a><br></p>
<div class="REFBODY">
<p>Types:</p>
        <div class="REFTYPES">
<span class="bold_code">Error = term()</span><br>
</div>
      </div>
<div class="REFBODY"><p>
        <p><span class="code">save_scenario/0</span> saves information about the current
          runtime scenario. This information will later be used when
          <span class="bold_code"><a href="#make_config-0">make_config/0</a></span>,
          or <span class="bold_code"><a href="#make_config-1">make_config/1</a></span>
          is called.</p>
        <p>The first time <span class="code">save_scenario/0</span> is called a server
          will be started. This server will save runtime scenarios. All
          saved scenarios can be removed by calling
          <span class="bold_code"><a href="#make_config-0">stop/0</a></span>.</p>
      </p></div>
    <p><a name="make_config-0"><span class="bold_code">make_config() -&gt; ok | {error, Error}</span></a><br></p>
<div class="REFBODY">
<p>Types:</p>
        <div class="REFTYPES">
<span class="bold_code">Error = term()</span><br>
</div>
      </div>
<div class="REFBODY"><p>
        <p>This is the same as calling
          <span class="bold_code"><a href="#make_config-1">make_config(group_leader())</a></span>.</p>
      </p></div>
    <p><a name="make_config-1"><span class="bold_code">make_config(FileNameOrIODev) -&gt; ok | {error, Error}</span></a><br></p>
<div class="REFBODY">
<p>Types:</p>
        <div class="REFTYPES">
<span class="bold_code">FileNameOrIODev = string() | io_device()</span><br>
</div>
        <div class="REFTYPES">
<span class="bold_code">Error = term()</span><br>
</div>
      </div>
<div class="REFBODY"><p>
        <p><span class="code">make_config/1</span> uses the information previously saved by
          <span class="bold_code"><a href="#save_scenario-0">save_scenario/0</a></span>
          in order to produce an <span class="code">erts_alloc</span> configuration. At
          least one scenario have had to be saved. All scenarios
          previously saved will be used when creating the
          configuration.  </p>
        <p>If <span class="code">FileNameOrIODev</span> is a <span class="code">string()</span>,
          <span class="code">make_config/1</span> will use <span class="code">FileNameOrIODev</span> as a
          filename. A file named <span class="code">FileNameOrIODev</span> is created and
          the configuration will be written to that file. If
          <span class="code">FileNameOrIODev</span> is an
          <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','stdlib','io.html');">io_device()</a></span> (see the
          documentation of the module
          <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','stdlib','io.html');">io</a></span>), the configuration
          will be written to the io device.</p>
      </p></div>
    <p><a name="stop-0"><span class="bold_code">stop() -&gt; ok | {error, Error}</span></a><br></p>
<div class="REFBODY">
<p>Types:</p>
        <div class="REFTYPES">
<span class="bold_code">Error = term()</span><br>
</div>
      </div>
<div class="REFBODY"><p>
        <p>Stops the server that saves runtime scenarios.</p>
      </p></div>
  

  <h3><a name="id68748">See Also</a></h3>
<div class="REFBODY">
    
    <p><span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','erts','erts_alloc.html');">erts_alloc(3)</a></span>,
      <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','erts','erl.html');">erl(1)</a></span>,
      <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','stdlib','io.html');">io(3)</a></span></p>
  </div>
</div>
<div class="footer">
<hr>
<p>Copyright © 1999-2012 Ericsson AB. All Rights Reserved.</p>
</div>
</div>
</div></body>
</html>