Reply to Re: php memory questions

Your name:

Reply:


Posted by ImOk on 07/06/06 13:34

For memory variables you shouldnt have to do anything. PHP handles
everything through garbage collection.

But for database resources, sometimes you may have to. E.g. handles to
databases and tables. If you don't, the handle gets destroyed but the
allocated resource is still there in memory and repeated calls to
connect/execute you will have a memory leak.

Always close handles.


Colin McKinnon wrote:
> cmills28@yahoo.com wrote:
>
> > I'm using php 4.3, and I"m wondering when is it a good idea to use this
> > unset() function to free a variable?
>
> It rather depends what for and where you're using it.
>
> Assuming its for generating web pages, called as CGI, fast CGI or module,
> then don't worry - the runtime memory gets blown away after servicing each
> request.
>
> IME PHP does a very good job of tracking what memory it has allocated - I've
> run servers fielding millions of hits per day and only had to take them
> down for patching.
>
> C.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация