[pLog-svn] Some programming questions?

Mark Wu markplace at gmail.com
Wed Mar 5 23:02:37 EST 2008


>
>
> >  As far as I know, PHP's garbage collector will free the memory used by
> >  an object as soon as the object is out of the current execution scope.
>
>
> garbage collection should come with some costs, although I didn't do
> the actual testings


Howard, perhaps you can do some tests for this to support the idea.

>  This means that if I create an object of type User via the "new"
> >  operator in my own function, its memory will be freed as soon as I
> >  leave my function. However, if I use a static reference to that
> >  object, its memory will not be freed until the request is over.
> >


Oscar, You are right about this , I really forget PHP5's own garbage
collection, according  to the search results of google, the memory will
release when the function is close.

This is good, so you can have internal cache, to avoid duplicated query.


mmm...., Lifetype already has it's own DAO cache, I think this is not the
problem.

Howard
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://limedaley.com/pipermail/plog-svn/attachments/20080306/9c41d080/attachment.htm 


More information about the pLog-svn mailing list