php-doc-en/reference/info/functions/memory-get-usage.xml
Philip Olson f234861e96 Initial documentation.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@130546 c90b9560-bf6c-de11-be94-00142212c4b1
2003-06-07 15:20:43 +00:00

73 lines
1.8 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.memory-get-usage">
<refnamediv>
<refname>memory_get_usage</refname>
<refpurpose>Returns the amount of memory allocated to PHP</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>memory_get_usage</methodname>
<void />
</methodsynopsis>
<para>
Returns the amount of memory, in bytes, that's currently being
allocated to your PHP script.
</para>
<para>
<function>memory_get_usage</function> will only be defined if your PHP
is compiled with the <literal>--enable-memory-limit</literal>
configuration option.
</para>
<para>
<example>
<title>A <function>memory_get_usage</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
// This is only an example, the numbers below will
// differ depending on your system
echo memory_get_usage() . "\n"; // 36640
$a = str_repeat("Hello", 4242);
echo memory_get_usage() . "\n"; // 57960
unset($a);
echo memory_get_usage() . "\n"; // 36744
?>
]]>
</programlisting>
</example>
</para>
<para>
See also
<link linkend="ini.memory-limit">memory-limit</link>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->