Re: One suggestion to PHP-FPM
| From: | looyao teng | Date: | Mon, 26 Apr 2010 02:02:10 +0000 |
| Subject: | Re: One suggestion to PHP-FPM | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-48075@lists.php.net to get a copy of this message | ||
in linux, read the /proc/self(pid)/status, and the VmRSS(real memory usage)
or VmSize(virtual memory usage) is the the memory usage of the current
process.
2010/4/24 Jérôme Loyet <jerome@loyet.net>
> 2010/4/14 Rasmus Lerdorf <rasmus@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.
>
> does someone know a way to get the memory usage of the current process ?
> getrusage is not accurate in linux.
>
> Thx
> ++ jerome
>