Re: PHP4: php_module holds memory to long !

From: Date: Wed, 10 Jan 2001 19:54:01 +0000
Subject: Re: PHP4: php_module holds memory to long !
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-43721@lists.php.net to get a copy of this message
SV>> How does Zend allocate memory then? I guess I could try to SV>> figure it out myself, but it's a bit complex. Are there many SV>> small chunks? Seems like emalloc() is called a lot creating SV>> small chunks, but each emalloc() doesn't result in a SV>> corresponding malloc() perhaps? I guess with glibc on Linux it emalloc caches small memory blocks (certain amount of them), which are pre-allocated at the init time. I.e., actual malloc() doesn't get called every time emalloc() is called. But this cache is mostly useful for Zend's own memory allocations, it won't help if you allocate a lot of space in your scripts. SV>> would be nice if malloc() allocated say 128k chunks, and SV>> emalloc() used memory inside those. That would require us to implement own memory management, which is not too simple. -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115

« previous php.dev (#43721) next »