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

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.