Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tag: php-5.6.0alpha3

Fetching latest commit…

Cannot retrieve the latest commit at this time

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

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.
Something went wrong with that request. Please try again.