I have a some javascript (used with google maps api) that I am testing on IE and Chrome and noticed memory leak symptoms in IE only: when I refresh the page continuously, the amount of memory used in IE keeps growing (fast), but in Chrome it stays constant. Without posting all of the code (as it is rather long), can I get some suggestions as to what to look out for? What could cause the memory to keep growing like this in IE on page refreshes?
Like I said I know its hard without code, but I'd like to see if any generic advice works first. Thanks.
Update: thanks for the responses so far. As a sanity check, I ran the google maps api "Hello World" code from google to see what would happen in IE (the code is shown below). When running this code in IE, when I keep refreshing the page over and over again, the memory keeps growing and growing. Is this a memory leak? This doesnt seem like intended functionality...
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>
Update 2: So is there no way to get this google Hello World map api code to run without leaking memory in IE? I noticed that if I run the same experiment on maps.google.com there doesn't seem to be a leak...It would be great if someone could help me modify the hello world code so that it does not leak in IE; this way I can build off of it (I don't mind using JQuery if this would help, but I tried it on the Hello World code and it was still leaking in IE). Thanks again