Re: php cli question
| From: | J Ravi Menon | Date: | Tue, 14 Sep 2010 17:35:03 +0000 |
| Subject: | Re: php cli question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-308069@lists.php.net to get a copy of this message | ||
On Tue, Sep 14, 2010 at 12:43 AM, Per Jessen <per@computer.org> wrote:
> 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.
Just to clarify, you mean we don't need the op-code cache here right?
>
>> 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.
>
So 'unset($some_big_array)' or 'unset($some_big_object)' etc.. is the
right way to go for non-resource based items? i.e. it needs to be
explicitly done?
thx,
Ravi
>> 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)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>