Re: php cli question
| From: | Per Jessen | Date: | Tue, 14 Sep 2010 07:43:16 +0000 |
| Subject: | Re: php cli question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-308058@lists.php.net to get a copy of this message | ||
J Ravi Menon wrote:
> Few questions:
>
> 1) Does opcode cache really matter in such cli-based daemons? As
> 'SomeClass' is instantiated at every loop, I am assuming it is only
> compiled once as it has already been 'seen'.
Yup.
> 2) What about garbage collection? In a standard apache-mod-php setup,
> we rely on the end of a request-cycle to free up resources - close
> file descriptiors, free up memory etc..
> I am assuming in the aforesaid standalone daemon case, we would
> have to do this manually?
Yes.
> Note: I have written pre-forker deamons in php directly and
> successfully deployed them in the past, but never looked at in depth
> to understand all the nuances. Anecdotally, I have
> done 'unset()' at some critical places were large arrays were used,
> and I think it helped. AFAIK, unlike Java, there is no 'garbage
> collector' thread that does all the magic?
Correct.
--
Per Jessen, Zürich (12.9°C)