Op 26-4-2010 13:18, Jérôme Loyet schreef:
Le 26 avril 2010 13:12, Antony Dovgal<t...@daylessday.org>  a écrit :
On 26.04.2010 14:08, Jérôme Loyet wrote:
What exactly are you going to do?
Killing a process is as easy as exit(), no interfacing is needed.

and when threads are used ? You'll kill all threads at once without
waiting them to finish what they're doing at the time ?

Let's start from the beginning.
How are you going to detect how much memory a thread consumes?

no ideas

It doesn't matter: Memory is process based; so if the process takes too much memory; the process should die. But the SAPI should handle the actual killing of the process; as the SAPI is the only one who knows how much (if any) other threads are still running (correct me if I'm wrong). So, how about moving the calculation code from pecl/memtrack to PHP-core and let both FPM and memtrack use that code?
memtrack could do the usual trick; stopping the current script or whatever.
and FPM could flag the process as 'over the memory limit' and can kill it as soon as there are no other threads running in that process.

-- Jille

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to