downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/function.memory-get-peak-usage.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.info.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.memory-get-peak-usage.php',
   
1 => 'memory_get_peak_usage',
  ),
 
'up' =>
  array (
   
0 => 'ref.info.php',
   
1 => 'PHP Options/Info Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.main.php',
   
1 => 'main',
  ),
 
'next' =>
  array (
   
0 => 'function.memory-get-usage.php',
   
1 => 'memory_get_usage',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.memory-get-peak-usage" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">memory_get_peak_usage</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0)</p><p class="refpurpose"><span class="refname">memory_get_peak_usage</span> &mdash; <span class="dc-title">Returns the peak of memory allocated by PHP</span></p>

 </div>

 <a name="function.memory-get-peak-usage.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><b>memory_get_peak_usage</b></span>
    ([ <span class="methodparam"><span class="type">bool</span> <tt class="parameter">$real_usage</tt><span class="initializer"> = false</span></span>
  ] )</div>

  <p class="para rdfs-comment">
   Returns the peak of memory, in bytes, that&#039;s been allocated to your PHP
   script.
  </p>
 </div>


 <a name="function.memory-get-peak-usage.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">real_usage</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       Set this to <b><tt class="constant">TRUE</tt></b> to get the real size of memory allocated from
       system. If not set or <b><tt class="constant">FALSE</tt></b> only the memory used by
       <i>emalloc()</i> is reported.
      </p>
     </dd>

   
   </dl>
<p>
  </p>
 </div>


 <a name="function.memory-get-peak-usage.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the memory peak in bytes.
  </p>
 </div>


 <a name="function.memory-get-peak-usage.changelog"></a><div class="refsect1 changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   </p><table class="doctable informaltable">
   
     <thead valign="middle">
      <tr valign="middle">
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody valign="middle" class="tbody">
      <tr valign="middle">
       <td align="left">5.2.1</td>
       <td align="left">
        Compiling with <a href="ini.core.php#ini.memory-limit" class="link">--enable-memory-limit</a>
        is no longer required for this function to exist.
       </td>
      </tr>

      <tr valign="middle">
       <td align="left">5.2.0</td>
       <td align="left">
        <i><tt class="parameter">real_usage</tt></i>
 was added.
       </td>
      </tr>

     </tbody>
   
   </table>
<p>
  </p>
 </div>


 <a name="function.memory-get-peak-usage.seealso"></a><div class="refsect1 seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   </p><ul class="simplelist">
    <li class="member"><a href="function.memory-get-usage.php" class="function" rel="rdfs-seeAlso">memory_get_usage()</a> - Returns the amount of memory allocated to PHP</li>
    <li class="member"><a href="ini.core.php#ini.memory-limit" class="link">memory_limit</a></li>
   </ul><p>
  </p>
 </div>


</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites