[ale] Possible javascript memory leak?

Ron Frazier (ALE) atllinuxenthinfo at techstarship.com
Thu May 3 10:16:44 EDT 2012


Hi Jim,

Others have commented on your script.  I also wanted to mention that 
Firefox has been having problems with ballooning memory usage ever since 
version 3 or 4.  There have been lots of people complaining about it.  
 From the podcasts I listen to, it seems it's pretty much fixed in 
version 12.  You might want to use that one to give yourself maximum 
chances for success.  I don't know anything about chrome.

Sincerely,

Ron


On 5/3/2012 6:51 AM, Jim Lynch wrote:
> I'm running a  small javascript script using the setInterval function.
> Under both Chrome and FF it leaks memory, or at least it keeps consuming
> memory until the system crashes, or freezes up.
>
> Here's the script.
>
> $(document).ready(function()
> {
>       var refreshId = setInterval( function()
>       {
>           var r = (-0.5)+(Math.random()*(100));
>           console.log(r);
>           $('#img-container').attr('src','img.php?h='+r);
>       }, 3000);
> });
>
> Is there something wrong with it?  Any suggestions on how to cure the
> problem without restarting the browser?  The php code reads a .png file,
> adds a bit of text to it and outputs it so it is displayed.
>
> Thanks,
> Jim.
>
>    

-- 

(To whom it may concern.  My email address has changed.  Replying to former
messages prior to 03/31/12 with my personal address will go to the wrong
address.  Please send all personal correspondence to the new address.)

(PS - If you email me and don't get a quick response, you might want to
call on the phone.  I get about 300 emails per day from alternate energy
mailing lists and such.  I don't always see new messages very quickly.)

Ron Frazier

770-205-9422 (O)   Leave a message.
linuxdude AT techstarship.com



More information about the Ale mailing list