1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-25 16:02:13 +01:00
Files
archived-doc-es/reference/memtrack/examples.xml
Pedro Antonio Gil Rodríguez f0bf36199b Updated to the most recent version
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@310974 c90b9560-bf6c-de11-be94-00142212c4b1
2011-05-12 15:45:43 +00:00

70 lines
1.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 79dcbe011fb254dcd92c597064571fe313362a09 Maintainer: seros Status: ready -->
<appendix xml:id="memtrack.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<section xml:id="memtrack.examples.basic">
<title>Uso básico</title>
<para>
Ejemplo básico del uso de la extension memtrack:
<example>
<title>Crear una matriz grande en una función</title>
<programlisting role="php">
<![CDATA[
<?php
/* /tmp/ejemplo1.php */
function foo() {
$a = array();
for ($i = 0; $i < 10000; $i++) $a[] = "test";
return $a;
}
$arr = foo();
?>
]]>
</programlisting>
</example>
</para>
<para>
Ejecutar el ejemplo con el siguiente comando:
</para>
<screen>
<![CDATA[
php -d memtrack.enabled=1 -d memtrack.soft_limit=1M -d memtrack.vm_limit=3M /tmp/ejemplo1.php
]]>
</screen>
&example.outputs.similar;
<screen>
<![CDATA[
Warning: [memtrack] [pid 26177] user function foo() executed in /tmp/ejemplo1.php on line 10 allocated 4194304 bytes in /tmp/ejemplo1.php on line 0
Warning: [memtrack] [pid 26177] virtual memory usage on shutdown: 32911360 bytes in Unknown on line 0
]]>
</screen>
</section>
</appendix>
<!-- 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
-->