Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 43 lines (29 sloc) 1.37 kb
184b2e5 MFH
Jani Taskinen authored
1 Zend Memory Manager
2 ===================
92f080a Missing file..
foobar authored
3
184b2e5 MFH
Jani Taskinen authored
4 General:
5 --------
92f080a Missing file..
foobar authored
6
184b2e5 MFH
Jani Taskinen authored
7 The goal of the new memory manager (available since PHP 5.2) is to reduce memory
8 allocation overhead and speedup memory management.
92f080a Missing file..
foobar authored
9
184b2e5 MFH
Jani Taskinen authored
10 The new manager's "configure" has no "--disable-zend-memory-manager" option,
11 but it has "--enable-malloc-mm" instead. It is enabled by default in DEBUG
12 build and disabled by default in RELEASE build. when enabled it allows selecting
13 between malloc and emalloc at runtime so you can use internal and external memory
14 debuggers without recompilation.
92f080a Missing file..
foobar authored
15
184b2e5 MFH
Jani Taskinen authored
16 Debugging:
17 ----------
92f080a Missing file..
foobar authored
18
184b2e5 MFH
Jani Taskinen authored
19 Normal:
92f080a Missing file..
foobar authored
20
184b2e5 MFH
Jani Taskinen authored
21 $ sapi/cli/php -r 'leak();'
22
23 Zend MM disabled:
24
25 $ USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php -r 'leak();'
26
ecf8986 Add the ZEND_DONT_UNLOAD_MODULES environment variable for debugging to 5...
Derick Rethans authored
27 Shared extensions:
28 ------------------
29
c9436c2 Fixed version numbers.
Derick Rethans authored
30 Since PHP 5.3.11 it is possible to prevent shared extensions from unloading so
ecf8986 Add the ZEND_DONT_UNLOAD_MODULES environment variable for debugging to 5...
Derick Rethans authored
31 that valgrind can correctly track the memory leaks in shared extensions. For
32 this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then
33 DL_UNLOAD() is skipped during the shutdown of shared extensions.
34
184b2e5 MFH
Jani Taskinen authored
35 Tweaking:
36 ---------
37
38 The Zend MM can be tweaked using ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE environment
39 variables. Default values are "malloc" and "256K". Dependent on target system you
40 can also use "mmap_anon", "mmap_zero" and "win32" storage managers.
41
42 $ ZEND_MM_MEM_TYPE=mmap_anon ZEND_MM_SEG_SIZE=1M sapi/cli/php ..etc.
Something went wrong with that request. Please try again.