mirror of
https://github.com/php/doc-es.git
synced 2026-03-23 23:12:09 +01:00
111 lines
2.7 KiB
XML
111 lines
2.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 9af43469f46843451955b8926fe470a9f3d45034 Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="function.memory-get-usage" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>memory_get_usage</refname>
|
|
<refpurpose>Indica la cantidad de memoria utilizada por PHP</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>memory_get_usage</methodname>
|
|
<methodparam choice="opt"><type>bool</type><parameter>real_usage</parameter><initializer>&false;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Devuelve la cantidad de memoria asignada a PHP en este momento.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>real_usage</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Definir como &true; para obtener el tamaño total de la memoria asignada
|
|
por el sistema. Si este argumento no está definido o es &false;,
|
|
solo se retornará la memoria utilizada.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
<note>
|
|
<para>PHP solo puede rastrear la memoria asignada por <literal>emalloc()</literal></para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve la cantidad de memoria, en bytes.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo con <function>memory_get_usage</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Esto es solo un ejemplo. Los números a continuación
|
|
// variarán según los sistemas y las configuraciones
|
|
|
|
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>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>memory_get_peak_usage</function></member>
|
|
<member><link linkend="ini.memory-limit">memory_limit</link></member>
|
|
</simplelist>
|
|
</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:"~/.phpdoc/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
|
|
-->
|