Forum Moderators: coopster

Message Too Old, No Replies

Could be a php memory leak of some other sort of leak?

Must be my own website that slows my pc down.

         

Nika

6:31 am on Feb 16, 2005 (gmt 0)

10+ Year Member



What I'm concerned with is whether my website - in which I'm digging in all the time continiously optimizing it and phishing "bugs" and mistakes (those I'm producing repeatedly while this job) - this website could stuck the memory up while being serfed by me 3-5 hours each session? The pages are dynamic and are "wrapped" into the same template page, which on its turn has some objects and graphics as preloaded on open - does it mean that this template preloads all the stuff every time I open any new page or the same page all over again? Could that overload the memory after some long period of "persistent torchure" of the pc? Also I heard about such a thing as PHP memory leak - could this be that? Because after some hours of work my pc falls asleep. I'm aware of regular things like ie hijeckings or app-s launching threads that never end checking task manager all the time - these things don't take place so far, that's my website that causes a problem - I'm almost 100% confident.

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

mincklerstraat

8:15 am on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is the site on your PC, or a remote server?
If the site's on a remote server, it's highly unlikely that anything that PHP is responsible is slowing down your PC. Some weird javascripts or applets you have on your site - they might possibly slow down your site.

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.

Nika

4:19 pm on Feb 20, 2005 (gmt 0)

10+ Year Member



Thanks,

Well, maybe Macromedia inputs its share in this? While surfing my website I'm also constantly redesigning it in dreamweaver. Must be this.

hakre

5:38 pm on Feb 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



okay, dreamweaver is far away from beign leak proofed - that software is famous for being leaky.