Forum Moderators: coopster
Chiniese say something like: "If stay long enough at the river side You might see the body of your enemy drifting by". If trying hard and long you could overload the memory even leaking smallest portions each time. That's what I mean. And certainly there should be recommended PHP programming techniques that provide with memory caring programming manner - killing threads or freeing graphics from memory on exit of every dynamic page and things like this... Whould be happy to learn about such things. Any targeted reference or advise, anything will be much appreciated.
Nick
If the site's on your pc as well, and you're using your pc as a server, it is possible, but I think rather uncommon, for running the PHP scripts on the server to cause your PC to slow down. PHP is a 'stateless' language, so there's nothing really happening with PHP at any moment that you aren't requesting a page, or between page requests. PHP also does a pretty good job at 'garbage collection', which means that it frees resources which were in use during page execution. This means that there aren't many things you have to worry about regarding memory, PHP does this automatically. If you use, for example, mysql_connect to connect to your database, PHP will close the connection at the end of your page, without you having done anything.
When it comes to pointers, I can't really think any except:
- do you use persistent database connections (mysql_pconnect)? If so, this might be contributing to your problem.
- it's still recommended to use imagedestroy() if you use the GD library for creating images (which most programmers don't).
Also, just you surfing your site for 3-5 hours normally wouldn't be a very big deal to PHP; PHP should be able to handle a lot more thrown at it than that - a lot of people surfing your site simultaneously.