Memory leak using grid in IE?
I've found an apparent memory leak using the grid control in IE 6. Below is my source code:
The data source is an XML document returned by a Java servlet. Below is an example:
Basically my grid is set up to autorefresh itself periodically from the server. My example above does this every 5 seconds, which is too frequent for production use but helps illustrate the problem faster. The XML my server returns currently has 30 <message> elements in it.
What I'm seeing is that letting this run leads to a gradual increase in IE's memory footprint of approximately 500KB every 10 minutes. This is not the case in Firefox -- it seems to run fine in that browser.
IE version: 6.0.2900.2180.xpsp_sp2_gdr.050301-1519
AW version: 2.0.1
OS: WinXP sp2
Any ideas what might be wrong?
<html>
<head>
<title>IE Memory Leak Test</title>
<script src="scripts/aw.js"></script>
<link href="styles/aw.css" rel="stylesheet"></link>
</head>
<body>
<div>
<script>
var table = new AW.XML.Table;
table.setURL("getMessageList?random=" + new Date().getTime());
table.setColumns(
[
'expireWarn', // 0
'hasAttach', // 1
'sender', // 2
'subject', // 3
'dateReceived', // 4
'size', // 5
'messageId', // 6
'dateExpires' // 7
]);
table.request();
var grid = new AW.UI.Grid;
grid.setId("messageGrid");
grid.setColumnCount(9);
grid.setSelectionMode("single-row");
grid.setCellModel(table);
grid.setSelectorVisible(true);
grid.setSelectorText(function(i){return this.getRowPosition(i)+1});
grid.setSelectorWidth(25);
document.write(grid);
grid.setTimeout(updateTable, 5000);
function updateTable() {
table.setURL("getMessageList?random=" + new Date().getTime());
table.request();
grid.setTimeout(updateTable, 5000);
}
</script>
</div>
</body>
</html>
The data source is an XML document returned by a Java servlet. Below is an example:
<data>
<message>
<messageId>k56FaFKG024213</messageId>
<sender>user1@example.com</sender>
<subject>testing1</subject>
<dateReceived>06/06/2006 08:36:28</dateReceived>
<size>13 KB</size>
<dateExpires>12/31/2006 02:01:01</dateExpires>
<expireWarn>0</expireWarn>
<hasAttach></hasAttach>
</message>
<message>
<messageId>k56FaFKG024213</messageId>
<sender>user2@example.com</sender>
<subject>testing2</subject>
<dateReceived>06/06/2006 08:36:28</dateReceived>
<size>13 KB</size>
<dateExpires>12/31/2006 02:01:01</dateExpires>
<expireWarn>0</expireWarn>
<hasAttach></hasAttach>
</message>
[b][i]...a bunch more similar entries removed for brevity...[/i][/b]
</data>
Basically my grid is set up to autorefresh itself periodically from the server. My example above does this every 5 seconds, which is too frequent for production use but helps illustrate the problem faster. The XML my server returns currently has 30 <message> elements in it.
What I'm seeing is that letting this run leads to a gradual increase in IE's memory footprint of approximately 500KB every 10 minutes. This is not the case in Firefox -- it seems to run fine in that browser.
IE version: 6.0.2900.2180.xpsp_sp2_gdr.050301-1519
AW version: 2.0.1
OS: WinXP sp2
Any ideas what might be wrong?
Trevor
July 12,