From 79dbcf042c463916a2a164f5f8d7fdedf8ce1d6f Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Fri, 13 Feb 2009 10:46:14 +0000 Subject: [PATCH] add first version of PECL/memtrack docs git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@275736 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/memtrack/book.xml | 61 ++++++++++++ reference/memtrack/configure.xml | 33 +++++++ reference/memtrack/constants.xml | 29 ++++++ reference/memtrack/examples.xml | 67 +++++++++++++ reference/memtrack/ini.xml | 165 +++++++++++++++++++++++++++++++ reference/memtrack/setup.xml | 43 ++++++++ 6 files changed, 398 insertions(+) create mode 100644 reference/memtrack/book.xml create mode 100644 reference/memtrack/configure.xml create mode 100644 reference/memtrack/constants.xml create mode 100644 reference/memtrack/examples.xml create mode 100644 reference/memtrack/ini.xml create mode 100644 reference/memtrack/setup.xml diff --git a/reference/memtrack/book.xml b/reference/memtrack/book.xml new file mode 100644 index 0000000000..3793ffe2e9 --- /dev/null +++ b/reference/memtrack/book.xml @@ -0,0 +1,61 @@ + + + + + + Memtrack + Memtrack + + + &reftitle.intro; + + The purpose of this extension is to detect the most memory hungry scripts + and functions. + + + memtrack tracks memory consumption in PHP scripts and produces reports + (warnings) when the consumption reaches certain levels set by the user. + This is achieved by replacing default executor function by a special + function which compares memory usage before and after running the + original executor - this way we can tell how much the memory usage + has changed during the execution of the current part of the code. + + + Zend Engine runs its executor for each opcode array (op_array), + which usually means function, plain script and such, so memtrack doesn't + have any noticeable effect on performance. + + + memtrack doesn't provide any functions, there are only INI directives which + allow you to configure the way it should work. + + &warn.experimental; + + + &reference.memtrack.setup; + &reference.memtrack.constants; + &reference.memtrack.examples; + + + + + diff --git a/reference/memtrack/configure.xml b/reference/memtrack/configure.xml new file mode 100644 index 0000000000..62b3f8e2ff --- /dev/null +++ b/reference/memtrack/configure.xml @@ -0,0 +1,33 @@ + + + +
+ &reftitle.install; + + &pecl.info; + http://pecl.php.net/package/memtrack + +
+ + + diff --git a/reference/memtrack/constants.xml b/reference/memtrack/constants.xml new file mode 100644 index 0000000000..4441c6ff32 --- /dev/null +++ b/reference/memtrack/constants.xml @@ -0,0 +1,29 @@ + + + + + &reftitle.constants; + &no.constants; + + + + diff --git a/reference/memtrack/examples.xml b/reference/memtrack/examples.xml new file mode 100644 index 0000000000..afdd1bbf00 --- /dev/null +++ b/reference/memtrack/examples.xml @@ -0,0 +1,67 @@ + + + + + &reftitle.examples; +
+ + Basic example on using memtrack extension: + + Creating large array in a function + + +]]> + + + + + Run the example with the following command: + + + + + &example.outputs.similar; + + + +
+
+ + + diff --git a/reference/memtrack/ini.xml b/reference/memtrack/ini.xml new file mode 100644 index 0000000000..751469c9f5 --- /dev/null +++ b/reference/memtrack/ini.xml @@ -0,0 +1,165 @@ + + +
+ &reftitle.runtime; + &extension.runtime; + + + Memtrack Configuration Options + + + + Name + Default + Changeable + + + + + memtrack.enabled + "0" + PHP_INI_SYSTEM + + + memtrack.soft_limit + "0" + PHP_INI_ALL + + + memtrack.hard_limit + "0" + PHP_INI_ALL + + + memtrack.vm_limit + "0" + PHP_INI_ALL + + + memtrack.ignore_functions + "" + PHP_INI_SYSTEM + + + +
+ &ini.php.constants; +
+ +&ini.descriptions.title; + + + + + + + memtrack.enabled + boolean + + + + Disables or enables the extension. Default value is 0, i.e. disabled. + + + + + + + memtrack.soft_limit + int + + + + Soft memory limit. + + + The extension checks memory consumption before and after executing an + op_array and produces a warning is the difference between the two values + is equal to or greater than the soft limit, but only if the function is not + ignored. + + + Setting this option to 0 also disables both soft and hard limit warnings. + Default value is 0, i.e. no warnings is produced. + + + + + + + memtrack.hard_limit + int + + + + Hard memory limit. + + + The extension checks memory consumption before and after executing an + op_array and produces a warning is the difference between the two values + is equal to or greater than the hard limit, even if the function is + ignored. + Setting this option to 0 disables hard limit warnings completely. + Default value is 0, i.e. no hard limit warnings is produced. + + + + + + + memtrack.vm_limit + int + + + + Virtual memory limit (set on a process). + + + This limit is checked only on shutdown and a warning is produced if the + value is greater than or equal to the limit. + + + This option is currently supported only on OSes where mallinfo() function + is available (i.e. Linux). + + + + + + + memtrack.ignore_functions + string + + + + A comma or whitespace-separated list of functions which are to be ignored + by soft_limit. The values are case-insensitive, for class methods use + class::method syntax. + + + + + + +
+ + diff --git a/reference/memtrack/setup.xml b/reference/memtrack/setup.xml new file mode 100644 index 0000000000..aa3a7e160e --- /dev/null +++ b/reference/memtrack/setup.xml @@ -0,0 +1,43 @@ + + + + + &reftitle.setup; + +
+ &reftitle.required; + &no.requirement; +
+ + &reference.memtrack.configure; + + &reference.memtrack.ini; + +
+ &reftitle.resources; + &no.resource; +
+ +
+ + +