Re: php cli question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



J Ravi Menon wrote:

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux