Please confirm this patch that fixes a memory leak.
We found this problem on svn rev.172, and examined the cause. Then it
turned out to be the following line:
jQuery.event.add( window, "load", jQuery.ready );
In the case of Firefox 1.5, IE and Opera 9, it seems to work without
this line. So we got to avoid the leak with the following patch:
--- jquery-svn172.js 2006-08-11 10:34:25.871263749 +0900
+++ jquery-svn172-patched.js 2006-08-11 10:34:25.870263917 +0900
@@ -3895,11 +3895,11 @@
jQuery.ready();
}
}, 10);
+ } else {
+ // A fallback to window.onload, that will always work
+ jQuery.event.add( window, "load", jQuery.ready );
}
- // A fallback to window.onload, that will always work
- jQuery.event.add( window, "load", jQuery.ready );
-
}
jQuery.fn.extend({
This improvement can be seen by monitoring the memory usage. The upper
image indicates the usage before fixing, and the lower one is for the
after. It consumed over 100M before the fix, but afterward it is
stabilized with only consuming less than 10MB.
Each test cases can be referred at the following URL:
[before the fix] http://pepper.sherry.jp/jquery/leakcheck_172.html
[after the fix] http://pepper.sherry.jp/jquery/leakcheck_172_patched.html
----
Taku Sano
jqueryleak.png
Description: PNG image
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
