I ran a couple of tests with sIEve on the Trinidad Online Demo ( http://www.irian.at/trinidad-demo/faces/index.jspx) and here are the results when pages are automatically refreshed: - index.jspx: memory leak present - componentDemos.jspx: memory leak NOT present (!!!) - outputText.jspx: memory leak present - tree.jspx: memory leak present When I say that a leak is present, I don't mean that sIEve identifies a leak in the page, but that the amount of memory used by IE keeps increasing.
I'm a bit puzzled by the fact that "componentDemos.jspx" doesn't leak, but " tree.jspx" does. The two pages share some Trinidad tags (commandLink, outputFormatted, tree), but not others. In particular, "componentDemos.jspx" uses: - panelPage - navigationPane - commandNavigationItem - panelHeader - outputText "tree.jsp" uses: - messages - panelGroupLayout - separator - inputText Do you think it's possible that the leak is linked to the way some Trinidad tags are rendered in the page, rather than to Common1_0_X.js (since this file is loaded in both cases)? Microsoft identifies three possible causes for IE leaking when javascript is present: - Circular references - Closures - DOM Insertion Order Leak Model While speaking about the DOM Insertion leak (that can be transparent to most leak-detection algorithms) they say: "[...] The key points to understand about the leak are that DOM elements are being created with scripts already attached. This is actually crucial to the leak, because if we create DOM elements that don't contain any script and attach them together in the same manner we don't have a leak problem. This gives rise to a second workaround that might be even better for larger subtrees (in the example we only have two elements, so building the tree off the primary DOM isn't a performance hit). The second workaround would be to create your elements with no scripts attached initially so that you can safely build your subtree. After you've attached your subtree to the primary DOM, go back and wire up any script events at that point." If you want to run some test on your apps too, you can download sIEve here: http://home.wanadoo.nl/jsrosman/ (thanks Max for the hint) Matthias, I'll help for sure. Max, I'll log an issue on JIRA. Bye Davide On Thu, Mar 27, 2008 at 1:36 PM, Max Starets <[EMAIL PROTECTED]> wrote: > Davide, > > What javascript libraries are used on the page? Is there anything else > beside Trinidad's library? > If you can reproduce memory leak with auto-refresh just with Trinidad > library, could you log > a JIRA issue, so that we could investigate? > > If other javascript code (event listeners) are present on the page, there > may be a number of reasons > why there would be memory leaks in IE, but not in Firefox. The most common > one is a presence of circular > (javscript-to-DOM) references. These are often caused by the use of > closures in Javacript. > > > Regards, > Max Starets > > > Davide Bonicelli wrote: > > Hi Max, > thanks for your help. > > I ran sIEve and pointed it the homepage of my application. > It didn't detect any leak, but three cycle dependencies and an orphan. I > cannot post the output of the scan because it's humongous! > However, if I run "Auto-refresh" on my app for few seconds, I can see the > memory usage increasing linearly with increments between 380Kb and 1500Kb > per refresh. Meanwhile, the number of nodes used in the DOM never exceed 92. > > At this point I suppose Trnidad is not leaking any memory, but somehow IE > is not releasing memory while navigating through the pages of my app. I > don't see this behaviour in IE if I "Auto-refresh" other websites (ex. > google.com), where the memory used by IE is stable. > > I also have to correct my previous post: a deeper analysis shows me that > Firefox is deallocating the memory correctly while using my app (too bad my > client wants to use IE7). > > I don't know if this problem is worthed a deeper investigation. > > Thanks > Bye > Davide > > > On Thu, Mar 27, 2008 at 9:53 AM, Max Starets <[EMAIL PROTECTED]> > wrote: > > > Hi Davide, > > > > If Trinidad's Javascipt library leaks memory when user navigates from > > page to page, it is not normal > > or acceptable. There are tools, such as "drip" and "sIEve" that van help > > us diagnose the problem. > > > > Regards, > > Max Starets > > > > Davide Bonicelli wrote: > > > Hi everybody, > > > I'm developing an application based on Trinidad 1.0.7, > > > JSF-Facelets 1.1.14, Spring 2.5.2 and Hibernate 3.2.3ga running on > > > Tomcat 5.5. > > > I noticed that while navigating through the pages of the application, > > > the browser keep consuming more and more memory (both IE7 and Firefox > > > 2). Every time I visit a page (even one I already visited in the same > > > session), the memory used by the browser increases by about 1.5MB (I > > > monitored it with Sysinternal). > > > If I disable javascript in IE7 and load different pages of my > > > application, this behavior stops and the memory used by the browser is > > > stable, but logically the application doesn't work anymore. > > > > > > Is it normal that the browser consumes all this memory when using > > > Trinidad? Did anybody else experienced this problem? > > > I suppose the problem is connected with Common1_0_7.js. > > > My concern is that I had the browser eating up to 350MB of memory in a > > > session of less than an hour and I don't want to have problems related > > > with memory consumption when the application goes into production and > > > is used for 8 hours a day by a user. > > > > > > Thanks for your help > > > Bye > > > Davide > > > > > > > > >

