8053 beefd0184a 2022-08-08 ct_chen 2 years ago
..
RFCs beefd0184a 2022-08-08 ct_chen 2 years ago
tests beefd0184a 2022-08-08 ct_chen 2 years ago
LICENSE beefd0184a 2022-08-08 ct_chen 2 years ago
Makefile.am beefd0184a 2022-08-08 ct_chen 2 years ago
Makefile.frag beefd0184a 2022-08-08 ct_chen 2 years ago
OBJECTS2_HOWTO beefd0184a 2022-08-08 ct_chen 2 years ago
README.ZEND_MM beefd0184a 2022-08-08 ct_chen 2 years ago
README.ZEND_VM beefd0184a 2022-08-08 ct_chen 2 years ago
ZEND_CHANGES beefd0184a 2022-08-08 ct_chen 2 years ago
Zend.dsp beefd0184a 2022-08-08 ct_chen 2 years ago
Zend.m4 beefd0184a 2022-08-08 ct_chen 2 years ago
ZendCore.dep beefd0184a 2022-08-08 ct_chen 2 years ago
ZendTS.dsp beefd0184a 2022-08-08 ct_chen 2 years ago
acinclude.m4 beefd0184a 2022-08-08 ct_chen 2 years ago
bench.php beefd0184a 2022-08-08 ct_chen 2 years ago
buildconf beefd0184a 2022-08-08 ct_chen 2 years ago
configure.in beefd0184a 2022-08-08 ct_chen 2 years ago
header beefd0184a 2022-08-08 ct_chen 2 years ago
micro_bench.php beefd0184a 2022-08-08 ct_chen 2 years ago
zend.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend.ico beefd0184a 2022-08-08 ct_chen 2 years ago
zend_API.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_API.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_alloc.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_alloc.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ast.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ast.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_build.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_builtin_functions.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_builtin_functions.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_closures.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_closures.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_compile.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_compile.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_config.nw.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_config.w32.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_constants.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_constants.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_default_classes.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_dtrace.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_dtrace.d beefd0184a 2022-08-08 ct_chen 2 years ago
zend_dtrace.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_dynamic_array.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_dynamic_array.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_errors.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_exceptions.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_exceptions.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_execute.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_execute.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_execute_API.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_extensions.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_extensions.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_float.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_float.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_gc.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_gc.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_generators.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_generators.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_globals.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_globals_macros.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_hash.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_hash.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_highlight.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_highlight.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_indent.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_indent.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ini.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ini.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ini_parser.y beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ini_scanner.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ini_scanner.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ini_scanner.l beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ini_scanner_defs.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_interfaces.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_interfaces.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_istdiostream.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_iterators.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_iterators.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_language_parser.y beefd0184a 2022-08-08 ct_chen 2 years ago
zend_language_scanner.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_language_scanner.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_language_scanner.l beefd0184a 2022-08-08 ct_chen 2 years ago
zend_language_scanner_defs.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_list.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_list.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_llist.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_llist.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_modules.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_multibyte.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_multibyte.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_multiply.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_object_handlers.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_object_handlers.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_objects.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_objects.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_objects_API.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_objects_API.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_opcode.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_operators.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_operators.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ptr_stack.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ptr_stack.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_qsort.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_qsort.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_signal.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_signal.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_sprintf.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_stack.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_stack.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_static_allocator.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_static_allocator.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_stream.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_stream.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_string.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_string.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_strtod.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_strtod.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ts_hash.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_ts_hash.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_types.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_variables.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_variables.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_virtual_cwd.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_virtual_cwd.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_vm.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_vm_def.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_vm_execute.h beefd0184a 2022-08-08 ct_chen 2 years ago
zend_vm_execute.skl beefd0184a 2022-08-08 ct_chen 2 years ago
zend_vm_gen.php beefd0184a 2022-08-08 ct_chen 2 years ago
zend_vm_opcodes.c beefd0184a 2022-08-08 ct_chen 2 years ago
zend_vm_opcodes.h beefd0184a 2022-08-08 ct_chen 2 years ago

README.ZEND_MM

Zend Memory Manager
===================

General:
--------

The goal of the new memory manager (available since PHP 5.2) is to reduce memory
allocation overhead and speedup memory management.

The new manager's "configure" has no "--disable-zend-memory-manager" option,
but it has "--enable-malloc-mm" instead. It is enabled by default in DEBUG
build and disabled by default in RELEASE build. When enabled it allows selecting
between malloc and emalloc at runtime so you can use internal and external memory
debuggers without recompilation.

Debugging:
----------

Normal:

$ sapi/cli/php -r 'leak();'

Zend MM disabled:

$ USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php -r 'leak();'

Shared extensions:
------------------

Since PHP 5.3.11 it is possible to prevent shared extensions from unloading so
that valgrind can correctly track the memory leaks in shared extensions. For
this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then
DL_UNLOAD() is skipped during the shutdown of shared extensions.


Tweaking:
---------

The Zend MM can be tweaked using ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE environment
variables. Default values are "malloc" and "256K". Dependent on target system you
can also use "mmap_anon", "mmap_zero" and "win32" storage managers.

$ ZEND_MM_MEM_TYPE=mmap_anon ZEND_MM_SEG_SIZE=1M sapi/cli/php ..etc.