J Ravi Menon wrote:

> On Tue, Sep 14, 2010 at 12:43 AM, Per Jessen <p...@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?

That is correct.

>>> 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?

It's not quite like C - if you reassign something, the previous contents
are automagically freed.  I use unset() if I know it could be a while
(hours) before it'll likely be reassigned, but it won't be used in the
meantime. 



-- 
Per Jessen, Zürich (14.6°C)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to