Hidden Loops and maybe crashing the server?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
avivm3
Forum Commoner
Posts: 31
Joined: Mon Jul 12, 2010 5:29 pm

Hidden Loops and maybe crashing the server?

Post by avivm3 »

So, I've got a web application that is mostly driven by AJAX and PHP. I'm very happy with how things are looking, except for symptoms that might add up to the same problem, I'm hoping...

If I'm watching the FireBug debugger window, I can see my page making multiple AJAX calls sometimes, when it should only be a single call (I'll look into whether or not the responseText confirms it is the same request). I've put some img tags at the end of some responseText, and put an alert() in the onload attribute. And I end up getting the alert multiple (almost always 3) times. I also have some jQuery animations on some li tags. One is triggered on mouseover, the other is triggered on mouseout (they do/undo a margin-right change, which pushes the other <li>s out of the way when your hovering over the >li> you want). Not always, but sometimes, if I mouseover one of these <li>s and then move on, the animation will repeat (usually 3 times).

Then, as far as performance, 2 things grow worse: my browser, and the server hosting my web app. I notice that as time goes on, my firefox.exe process (in Windows) grows, and has gone beyond 400,000K at times. That's not normal, is it? And now in the last two days, I've noticed the server (hosted remotely by [some company]) crapping out. It's starts timing out on this website (and not on other sites that I'm reasonably sure are hosted on the same server), or it get's socket errors, or there are connection issues with the database.

So, am I right to think these things are related? Where do I start looking?
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Hidden Loops and maybe crashing the server?

Post by kaszu »

If you are getting multiple requests, then there must be something wrong with your JS. You will have to post some code.
Animation repeats, because you don't stop previous animation. See http://api.jquery.com/stop/
On Ajax heavy websites firebug has this issue with memory, if you will turn firebug off, it will be ok.
Can't comment on server issues, have no idea.
Post Reply