Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Memory leaks?
- From: scott at randomchaos.com (Scott Reynen)
- Subject: [Javascript] Memory leaks?
- Date: Sat Apr 22 09:23:04 2006
I have a few AJAX applications, which work fine in IE, Firefox, and Safari, pinging the server every few seconds for new data. I've noticed that if I leave one of these applications open overnight in Safari (haven't tested this in anything else yet), the key event handling will slow to a crawl by morning and it will only register that I've typed something a second or two after I actually press the key. When I first open the application, such typing will register immediately. Even if I reload the page after this happens, it will still be slow until I actually restart the whole browser. I'm not clear on what's causing this, but it seems like a memory leak. Here are two applications that both seem to cause this problem: http://randomchaos.com/games/fastr/js/chat.js http://randomchaos.com/games/fastr/js/group.js The both involve typing in a text input, and they both take specific actions on the return/enter (13) keypress. Unfortunately, you won't be able to experience the problem yourself with registering and leaving it open for several hours. I'm sure there are a hundred problems with this code, as I'm largely self-taught in JavaScript. I'm specifically interested in the problem I described above, and would appreciate any suggestions in preventing such a gradual slowdown of the event handling. Peace, Scott
- Follow-Ups:
- [Javascript] Memory leaks?
- From: Laurent Muchacho
- [Javascript] Memory leaks?
- Prev by Date: [Javascript] IE 'css' menus
- Next by Date: [Javascript] Memory leaks?
- Previous by thread: [Javascript] looped var
- Next by thread: [Javascript] Memory leaks?
- Index(es):