We check error log after our server crashed, and we found that php heap memory is out of limit, so I think imagick use emalloc to allocate php heap memory, to check the zend_memory_usage is not a method for imagick, other circumstances which occupy huge memory can use this method to ensure the system have enough free memory.
thanks, looyao 2010/4/14 Rasmus Lerdorf <ras...@lerdorf.com> > On 04/14/2010 02:01 AM, Jérôme Loyet wrote: > > The patch seems good (I didn't test it yet) but I'm curious about the > > way you check the memory real size: > > > > + if(zend_memory_usage(1 TSRMLS_CC) > > > fpm_global_config.term_on_memory_limit){ > > > > I don't know much about the zend_memory_usage() function. But does it > > return the real memory size of the process ? > > Right, that will only give you the memory allocated by the memory > manager, obviously. But, pecl/imagick does seem to use emalloc to > allocate the imagick objects. However, if the underlying magickwand > library mallocs a bunch of temporary space on its own, this will not get > picked up. > > -Rasmus >