3.2.0

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:

<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,
Your XML have 8 columns and the code define 9, couldn't be that easy, and maybe not enough reason ??.
Typing mistake I suppose??. but you can try...just in case...
Carlos
July 12,
Nope, that didn't help -- thanks though.

(This is a cut-down version of my "real" app, which fills in some of the grid columns programmatically -- that's why the column count in the XML doesn't match the column count in the grid.)
Trevor
July 13,
Trevor,
I was running this sample on my desktop for an hour ( with exact same machine soft configuration ) I tested 100 xml records every 10 seconds, and can't see what you described, so wondering if could be any other code in that page.
Did you perform this check as you provided it ?? ( I mean alone )
Thanks
Carlos
July 14,
Or maybe the IE cache settings at server?? .. just a though
Carlos
July 14,
Yes, it seems like there is a small leak in IE (though I had it much smaller than you describe - 600K after 1 hour, 1 update in 5 sec). I'll try to find where it comes from.
Alex (ActiveWidgets)
July 14,

This topic is archived.

See also:


Back to support forum