New Memory Manager (Was: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard var.c /main main.c /sapi/apache mod_php5.c /sapi/apache2filter
sapi_apache2.c /sapi/apache2handler sapi_apache2.c /sapi/apache_hooks mod_php5.c)
| From: | Dmitry Stogov | Date: | Tue, 18 Jul 2006 09:23:50 +0000 |
| Subject: | New Memory Manager (Was: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard var.c /main main.c /sapi/apache mod_php5.c /sapi/apache2filter sapi_apache2.c /sapi/apache2handler sapi_apache2.c /sapi/apache_hooks mod_php5.c) |
||
| References: | 1 | Groups: | php.cvs php.internals |
| Request: | Send a blank email to php-cvs+get-39336@lists.php.net to get a copy of this message | ||
Hi,
The main reason of patch is reducing memory allocation overhead and speedup
memory management.
The patch requires full PHP rebuild including "buildconf".
Now "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 built. It allows select malloc/emalloc at
runtime. So you can use internal and external memory debuggers without
recompilation.
$ sapi/cli/php -r 'leak();'
$ USE_ZEND_ALLOC=0 valgrind --leak-check=full -r 'leak();'
The patch allows tweaking memory manager with 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
Thanks. Dmitry.
> -----Original Message-----
> From: Dmitry Stogov [mailto:dmitry@php.net]
> Sent: Tuesday, July 18, 2006 1:07 PM
> To: php-cvs@lists.php.net
> Subject: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard
> var.c /main main.c /sapi/apache mod_php5.c
> /sapi/apache2filter sapi_apache2.c /sapi/apache2handler
> sapi_apache2.c /sapi/apache_hooks mod_php5.c /win32/build
> config.w32 ZendEngine2
>
>
> dmitry Tue Jul 18 09:06:33 2006 UTC
>
> Modified files: (Branch: PHP_5_2)
> /php-src NEWS
> /ZendEngine2 Zend.m4 zend.c zend_API.h zend_alloc.c
> zend_alloc.h
> zend_compile.c zend_config.w32.h zend_execute.c
> zend_fast_cache.h zend_globals.h
> zend_globals_macros.h
> zend_mm.c zend_mm.h zend_operators.c
> /php-src/ext/standard var.c
> /php-src/main main.c
> /php-src/sapi/apache mod_php5.c
> /php-src/sapi/apache2filter sapi_apache2.c
> /php-src/sapi/apache2handler sapi_apache2.c
> /php-src/sapi/apache_hooks mod_php5.c
> /php-src/win32/build config.w32
> Log:
> New memory manager
>
>
>