TooN <to**@company.com> wrote in message
news:<181220031346399251%to**@company.com>...
I'm building an application with over 10thousand database entries. I
was wondering if it would be useful, regarding memory load and server
performance to unset/destroy objects at the moment when they are no
longer needed.
Will this improve performance, or will it not make any difference.
Surprise, surprise... Using unset() on an object DOES NOT free up
any memory in PHP 4. Zurab Davitiani posted his observations on the
subject to this newsgroup back in October:
http://groups.google.com/groups?hl=e...ws.prodigy.com
This is expected to be resolved in PHP 5, which implements
destructors.
Until then, your best bet for a high-performance memory-intensive
application is to ban OOP from it (which, in my book, is always a good
idea to consider when working with PHP. PHP does not run on a virtual
machine and has no system objects; all calls to OS and other low-level
software such as database engines are procedural, so there is no need
to introduce the overhead of OOP, unless you are into refactoring, in
which case you are simply buying shorter application development time
with lower application performance).
Cheers,
NC