DCSIMG
ArcGIS JavaScript API: IE Memory Leak Fix - Doron's .NET Space

ArcGIS JavaScript API: IE Memory Leak Fix

Since version 1.2 of the ArcGIS Javascript API, we've noticed a strange issue in both IE6 and IE7. When zooming in, memory consumption of the iexplore.exe process takes a huge jump and reaches up to 800-900 megabytes. When the operation ends, it goes back down to 50-60 megabytes. This has caused us a great deal of sorrow, as it sometimes caused our users' systems to hang.

This post in the ESRI forums explains, and also provides a fix. Apparently, the upgrade to dojo 1.2 has caused this zoom-animation related issue. To fix it, you should create a javascript file with this text:

 

/* * override the dojo 1.2, 1.3 version of dojo._setOpacity to revert back to the dojo 1.1 implementation * this version doesnt allow multiple filters on an element, but it is free from the memory spike issue */ (function() { var d = dojo; if(dojo.isIE) { dojo._setOpacity = function(/*DomNode*/node, /*Number*/opacity){ if(opacity == 1){ var filterRE = /FILTER:[^;]*;?/i; node.style.cssText = node.style.cssText.replace(filterRE, ""); if(node.nodeName.toLowerCase() == "tr"){ d.query("> td", node).forEach(function(i){ i.style.cssText = i.style.cssText.replace(filterRE, ""); }); } }else{ var o = "Alpha(Opacity="+ opacity * 100 +")"; node.style.filter = o; } if(node.nodeName.toLowerCase() == "tr"){ d.query("> td", node).forEach(function(i){ i.style.filter = o; }); } return opacity; }; } })();

 

Reference this javascript file from every page that has a reference to the Javascript API, and you're good to go.

Still, one can't help but wonder how the ESRI QA guys didn't notice this obvious shortcoming (which will be fixed at 1.4, they claim). Maybe they only used machines with lots of RAM. That's how we missed this at first... :)

Published Saturday, May 09, 2009 12:30 PM by dorony

Comments

# re: ArcGIS JavaScript API: IE Memory Leak Fix

i like to arcis 9 israel

Friday, January 08, 2010 10:07 AM by radad

# re: ArcGIS JavaScript API: IE Memory Leak Fix

Hello everyone. Pleasure to sign your guest book. I work for an advertising agency in Palestinian. Help me! Please help find sites for: Window coverings hints. I found only this - <a href="window-covering-store.biz/.../">window coverings photos</a>. Window covering, sledging dollars use a helping student at infection, simply and unlisted lemonades now to some loan of ligneacheter. Window covering, congressman cliff stearns of florida. Thanks for the help :o, Faisal from Palestinian.

Sunday, March 28, 2010 2:49 PM by Faisal

# re: ArcGIS JavaScript API: IE Memory Leak Fix

sarahhloveshp|hahha this is funny. i have toп»ї admit though the american accent makes me cringe a little bit. if you just made it sound a little less ditzy and valleygirlish it would sound a million times better;) not that it really matters lol &lt;3

 canadianstore.org

thplousaqq

Saturday, February 26, 2011 5:30 AM by HogFoegeTwine

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: