-
14 Oct 2010 12:27 PM #11Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
FWIW, the *leanest* code (does not recreate strings, objects, etc);
Code:var success_handler = function(response, opts){ makeRequest(); }, failure_handler = function(){ makeRequest(); }, ajaxCfg = { url: 'router.php', success: success_handler, failure: failure_handler, params: { foo: 'bar' } }; function makeRequest(){ Ext.Ajax.request(ajaxCfg); } makeRequest();
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
14 Oct 2010 12:30 PM #12Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
15 Oct 2010 1:56 PM #13
-
15 Oct 2010 2:15 PM #14
-
18 Oct 2010 12:12 AM #15Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
Trac is the issue tracker used internally by the Sencha team.
-
29 Mar 2012 6:40 AM #16
Sorry to respond to such an old thread, but this leak is still apparent in Ext 4.0.7 even. I have tested it on IE9 and it seems that the test case will leak more if you return a larger dataset from the server. The odd thing is that the current version of Google Chrome does not leak. With my test case I have also noticed that the memory does hit a ceiling and then stop (but I'm not sure why). I have been using Drip to test the explorer leak after reports of our actually application crashing browsers.memory_leak.png
The only difference between my test cases with 4.0.7 and 3.2.1 is that 4.0.7 takes about 3x longer to get to the same ceiling. I can provide my test cases if that will help.
And just so you know, the ceiling it hits is not reasonable for our actual user base, it's about 1.7 Gb
-
29 Mar 2012 7:27 AM #17
Hello again,
According to my research and testing, the issue is with this code in the Ext Base in 3.2.1:
the variable conn should not be referenced within the onreadystatechange, and 'this' should be used instead. There are also other variables being used from the outer scope and I'm not sure how to handle those, but according to the section: XmlHttpRequest memory management and leaks on this page: "http://javascript.info/tutorial/memo...js-memory-leak" this code will cause a memory leak. And I have tested from within my app to verify that it happens.Code:function handleReadyState(o, callback){ callback = callback || {}; var conn = o.conn, tId = o.tId, poll = pub.poll, cbTimeout = callback.timeout || null; if (cbTimeout) { pub.conn[tId] = conn; pub.timeout[tId] = setTimeout(function() { pub.abort(o, callback, true); }, cbTimeout); } poll[tId] = setInterval( function() { if (conn && conn.readyState == 4) { clearInterval(poll[tId]); poll[tId] = null; if (cbTimeout) { clearTimeout(pub.timeout[tId]); pub.timeout[tId] = null; } handleTransactionResponse(o, callback); } }, pub.pollInterval); }
Since 4.0.7 also leaks in the same manner, I assume this code has been carried over, or is still similar. I'm also surprised that more people haven't had this problem.
-
29 Mar 2012 7:57 AM #18
Actually, after more review of the code, I'm not sure if my last post makes sense, but I'm going to leave it there because I believe the issue is still around that code area.
-
10 May 2012 1:39 PM #19
I saw this thread again today... fyi, the source of the problem (or one of the sources, or part of the problem) is the way Extjs decodes json (which is used in the ajax call). It uses the eval function which is known to cause memory leaks when used. To work around this I used jQuery's ajax call (which is the only framework I could find that didn't leak in all browsers) and json_parse from https://github.com/douglascrockford/.../json_parse.js which does not use eval to avoid memory leaks. Just posting this to help others in the same situation as I, and maybe to help the Ext with their own solution to this problem.
-
31 Oct 2012 4:20 AM #20
Any more information on this topic?
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[OPEN-1001] Memory leak on buttons inside a window
By VT-TizianoF in forum Ext 3.x: BugsReplies: 2Last Post: 14 Oct 2010, 11:37 PM -
[OPEN][3.x] Floating Menu memory Leak - Ext.Shadows are never destroyed
By Pyja in forum Ext 3.x: BugsReplies: 14Last Post: 9 Dec 2009, 9:40 AM -
Partial solution to memory leak by ajax
By sean.zhou in forum Community DiscussionReplies: 4Last Post: 18 Nov 2008, 9:35 AM -
[2.2] Ext.QuickTips + ASP.NET AJAX = IE Memory Leak?
By SeiginoRaikou in forum Ext 2.x: BugsReplies: 14Last Post: 23 Sep 2008, 12:40 PM -
Ext.QuickTips + ASP.NET AJAX = IE Memory Leak?
By SeiginoRaikou in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 15 Sep 2008, 9:19 PM


Reply With Quote