Portal Home > Knowledgebase > Articles Database > Super-basic JavaScript slideshow... 2GB RAM...


Super-basic JavaScript slideshow... 2GB RAM...




Posted by fog, 07-31-2008, 11:55 AM
I have about 2GB of photos (taken from a high-res webcam every 15 minutes)... I threw together a quick little page with some JavaScript; basically, every second I update the .src image of the image to point to the next in the series, for a quick impromptu slideshow. The problem? It slows down after about 15 images... I looked and noticed that Firefox is using something like 10MB more RAM every second. I wrote this code the way I did specifically because I didn't want to keep calling new Image() objects and have a memory leak. There's nothing for me to "delete" -- the memory from the old images just isn't getting reclaimed. I have a little page that just has an image named "Argh" (now you know why...), and the following JavaScript... swap.js.php Edit: Looking over my code, it's awful-looking anyway, like the "next=count" bit... Temporarily overlook that, as that stuff got introduced as I kept changing stuff around.

Posted by foobic, 07-31-2008, 07:21 PM
Could it be caching the images to memory? Check your browser settings: http://kb.mozillazine.org/Browser.cache.memory.capacity If that is the issue you could try setting up the server to send no-cache headers.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
vpsresell.com down? (Views: 691)
Xen using more memory (Views: 609)
Foghosting.com DEAD ? (Views: 691)
D'Planet is down? (Views: 692)

Language: