You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Davide Bonicelli <da...@gmail.com> on 2008/03/27 15:39:49 UTC
[Trinidad] Browser memory consumption
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
Re: [Trinidad] Browser memory consumption
Posted by Matthias Wessendorf <ma...@apache.org>.
Hi,
On Thu, Mar 27, 2008 at 6:10 PM, Davide Bonicelli <da...@gmail.com> wrote:
> The cause of the problem is definitively the IE rendering engine:
> http://javascript.weblogsinc.com/2005/03/07/javascript-memory-leaks/
> http://www.posos.net/page/Index.cfm?SelNavID=2708
> http://msdn2.microsoft.com/en-us/library/bb250448(VS.85).aspx
thanks for sharing.
>
> Now my question is, do you think it's worthed the effort of trying to modify
> Common1_0_X.js to prevent the leak problem?
> Maybe using a solution like this one:
> http://novemberborn.net/javascript/event-cache (this won't work for
> Trinidad out of the box but we could use the same approach).
I'd say yes.
Willing to help ? ;-)
-Matthias
>
> Davide
>
>
> On Thu, Mar 27, 2008 at 11:21 AM, Davide Bonicelli <da...@gmail.com>
> wrote:
>
> >
> > Hi Volker and Renzo,
> > the page I'm using to test memory usage is very simple and doesn't use
> any custom javascript or PPR.
> >
> > Here is the code:
> >
> > /** LAYOUT **/
> >
> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> >
> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> >
> > <tr:document xmlns:ui="http://java.sun.com/jsf/facelets"
> >
> > xmlns:f="http://java.sun.com/jsf/core"
> >
> > xmlns:h="http://java.sun.com/jsf/html"
> >
> > xmlns:tr="http://myfaces.apache.org/trinidad"
> >
> > xmlns:trh="http://myfaces.apache.org/trinidad/html"
> >
> > title="Base test">
> >
> >
> >
> > <f:view>
> >
> >
> >
> > <head>
> >
> > <meta http-equiv="Content-Type"
> >
> > content="text/html; charset=iso-8859-1" />
> >
> > <title>RedMane Trinidad Test</title>
> >
> >
> >
> > <ui:insert name="beforeLoadScripts" />
> >
> >
> >
> > </head>
> >
> >
> >
> >
> >
> > <tr:form
> >
> > defaultCommand="#{defaultFormCommand != null ? defaultFormCommand :
> 'none'}"
> >
> > id="mainForm">
> >
> > <div id="header"><!-- HEADER MENU --> <ui:insert
> >
> > name="headerMenu">
> >
> > <ui:include src="headerMenu.xhtml" />
> >
> > </ui:insert></div>
> >
> >
> >
> > <div id="content">
> >
> > <div id="menuContent">
> >
> > <div id="logo">
> >
> > <h1><a href="#">Your Logo</a></h1>
> >
> > <h2><a href="http://www.redmane.com/">your link</a></h2>
> >
> > </div>
> >
> >
> >
> > <!-- LEFT SIDE MENU --> <ui:insert name="menu">
> >
> > <ui:include src="menu.xhtml" />
> >
> > </ui:insert></div>
> >
> >
> >
> > <div id="bodyContent">
> >
> > <div id="welcome"><!-- PAGE TITLE -->
> >
> > <h2><ui:insert name="title">Default Page title</ui:insert></h2>
> >
> >
> >
> > <!-- ERROR MESSAGES --> <tr:messages /> <!-- PAGE CONTENT --> <ui:insert
> >
> > name="content">
> >
> > <ui:include src="content.xhtml" />
> >
> > </ui:insert></div>
> >
> > </div>
> >
> > </div>
> >
> > <div style="height:20px;"/>
> >
> > <!-- FOOTER -->
> >
> > <ui:insert name="footer">
> >
> > <ui:include src="footer.xhtml" />
> >
> > </ui:insert>
> >
> >
> >
> > </tr:form>
> >
> >
> >
> > </f:view>
> >
> >
> >
> > <ui:insert name="afterLoadScripts"/>
> >
> >
> >
> > </tr:document>
> > /** THE PAGE **/
> > <tr:subform
> >
> >
> > xmlns:ui=http://java.sun.com/jsf/facelets
> >
> > xmlns:f="http://java.sun.com/jsf/core"
> >
> > xmlns:tr="http://myfaces.apache.org/trinidad">
> >
> >
> >
> > <ui:composition template="/layout/layout.xhtml">
> >
> >
> >
> > <ui:define name="title">Home Page</ui:define>
> >
> >
> >
> > <ui:define name="content">
> >
> > Welcome
> >
> >
> >
> > <p>
> >
> > <tr:group rendered="#{securityContext.ifAllGranted['ROLE_TEST']}">
> >
> > Testing ACEGI JSF
> >
> > </tr:group>
> >
> > </p>
> >
> >
> >
> > </ui:define>
> >
> >
> >
> > </ui:composition>
> >
> > </tr:subform>
> >
> > /** END OF CODE **/
> >
> > By simply refreshing this page, the IE keeps allocating more memory.
> >
> > Since Firefox is behaving fine, I suppose it's an IE7 problem, so we
> cannot do anything about it. I also made the same tests on maps.google.com
> (that for what I know uses a lot of AJAX and Javascript) and it presents the
> same behavior!
> >
> > I'll maybe post something on an IE forum, but I don't expect a quick
> solution to the problem (or any solution at all...) from Bill...
> >
> > Thanks again
> >
> > Davide
> >
> >
> >
> >
> > On Thu, Mar 27, 2008 at 10:54 AM, Volker Weber <v....@inexso.de> wrote:
> >
> > > Hi Davide,
> > >
> > > did you use own javascript in your app?
> > >
> > > If you assign htmlNode objects to javascript object properties and/or
> > > vice versa the IE (at least IE6) did not correct free them on page
> > > unload. You need to remove this yourself by assigning undefined to
> > > those properties in the unload handler.
> > >
> > > We had a similar problem in tobago which we solved this way.
> > >
> > >
> > > Regards,
> > > Volker
> > >
> > > 2008/3/27, Davide Bonicelli <da...@gmail.com>:
> > >
> > >
> > >
> > > > 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 <ma...@oracle.com>
> 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
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > inexso - information exchange solutions GmbH
> > > Bismarckstraße 13 | 26122 Oldenburg
> > > Tel.: +49 441 4082 356 |
> > > FAX: +49 441 4082 355 | www.inexso.de
> > >
> >
> >
>
>
--
Matthias Wessendorf
further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org
Re: [Trinidad] Browser memory consumption
Posted by Davide Bonicelli <da...@gmail.com>.
The cause of the problem is definitively the IE rendering engine:
http://javascript.weblogsinc.com/2005/03/07/javascript-memory-leaks/
http://www.posos.net/page/Index.cfm?SelNavID=2708
http://msdn2.microsoft.com/en-us/library/bb250448(VS.85).aspx
Now my question is, do you think it's worthed the effort of trying to modify
Common1_0_X.js to prevent the leak problem?
Maybe using a solution like this one:
http://novemberborn.net/javascript/event-cache (this won't work for
Trinidad out of the box but we could use the same approach).
Davide
On Thu, Mar 27, 2008 at 11:21 AM, Davide Bonicelli <da...@gmail.com>
wrote:
> Hi Volker and Renzo,
> the page I'm using to test memory usage is very simple and doesn't use
> any custom javascript or PPR.
>
> Here is the code:
>
> /** LAYOUT **/
>
> <!
> DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <
> tr:document xmlns:ui="http://java.sun.com/jsf/facelets"
>
> xmlns:f="http://java.sun.com/jsf/core"
>
> xmlns:h="http://java.sun.com/jsf/html"
>
> xmlns:tr="http://myfaces.apache.org/trinidad"
>
> xmlns:trh="http://myfaces.apache.org/trinidad/html"
>
> title="Base test">
>
> <f:view>
>
> <head>
>
> <meta http-equiv="Content-Type"
>
> content="text/html; charset=iso-8859-1" />
>
> <title>RedMane Trinidad Test</title>
>
> <ui:insert name="beforeLoadScripts" />
>
> </head>
>
>
>
> <tr:form
>
> defaultCommand="#{defaultFormCommand != null ? defaultFormCommand :
> 'none'}"
>
> id="mainForm">
>
> <div id="header"><!-- HEADER MENU --> <ui:insert
>
> name="headerMenu">
>
> <ui:include src="headerMenu.xhtml" />
>
> </ui:insert></div>
>
> <div id="content">
>
> <div id="menuContent">
>
> <div id="logo">
>
> <h1><a href="#">Your Logo</a></h1>
>
> <h2><a href="http://www.redmane.com/">your link</a></h2>
>
> </div>
>
> <!-- LEFT SIDE MENU --> <ui:insert name="menu">
>
> <ui:include src="menu.xhtml" />
>
> </ui:insert></div>
>
> <div id="bodyContent">
>
> <div id="welcome"><!-- PAGE TITLE -->
>
> <h2><ui:insert name="title">Default Page title</ui:insert></h2>
>
> <!-- ERROR MESSAGES --> <tr:messages /> <!-- PAGE CONTENT --> <ui:insert
>
> name="content">
>
> <ui:include src="content.xhtml" />
>
> </ui:insert></div>
>
> </div>
>
> </div>
>
> <div style="height:20px;"/>
>
> <!-- FOOTER -->
>
> <ui:insert name="footer">
>
> <ui:include src="footer.xhtml" />
>
> </ui:insert>
>
> </tr:form>
>
> </f:view>
>
> <ui:insert name="afterLoadScripts"/>
>
> </
> tr:document> /** THE PAGE **/
> <tr:subform
>
> xmlns:ui=http://java.sun.com/jsf/facelets
>
> xmlns:f="http://java.sun.com/jsf/core"
>
> xmlns:tr="http://myfaces.apache.org/trinidad">
>
> <ui:composition template="/layout/layout.xhtml">
>
> <ui:define name="title">Home Page</ui:define>
>
> <ui:define name="content">
>
> Welcome
>
> <p>
>
> <tr:group rendered="#{securityContext.ifAllGranted['ROLE_TEST']}">
>
> Testing ACEGI JSF
>
> </tr:group>
>
> </p>
>
> </ui:define>
>
> </ui:composition>
>
> </
> tr:subform>
>
> /** END OF CODE **/
>
> By simply refreshing this page, the IE keeps allocating more memory.
>
> Since Firefox is behaving fine, I suppose it's an IE7 problem, so we
> cannot do anything about it. I also made the same tests on maps.google.com(that for what I know uses a lot of AJAX and Javascript) and it presents the
> same behavior!
>
> I'll maybe post something on an IE forum, but I don't expect a quick
> solution to the problem (or any solution at all...) from Bill...
>
> Thanks again
>
> Davide
>
> On Thu, Mar 27, 2008 at 10:54 AM, Volker Weber <v....@inexso.de>
> wrote:
>
> > Hi Davide,
> >
> > did you use own javascript in your app?
> >
> > If you assign htmlNode objects to javascript object properties and/or
> > vice versa the IE (at least IE6) did not correct free them on page
> > unload. You need to remove this yourself by assigning undefined to
> > those properties in the unload handler.
> >
> > We had a similar problem in tobago which we solved this way.
> >
> >
> > Regards,
> > Volker
> >
> > 2008/3/27, Davide Bonicelli <da...@gmail.com>:
> > > 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 <ma...@oracle.com>
> > 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
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
> > --
> > inexso - information exchange solutions GmbH
> > Bismarckstraße 13 | 26122 Oldenburg
> > Tel.: +49 441 4082 356 |
> > FAX: +49 441 4082 355 | www.inexso.de
> >
>
>
Re: [Trinidad] Browser memory consumption
Posted by Davide Bonicelli <da...@gmail.com>.
Hi Volker and Renzo,
the page I'm using to test memory usage is very simple and doesn't use
any custom javascript or PPR.
Here is the code:
/** LAYOUT **/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<tr:document xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:tr="http://myfaces.apache.org/trinidad"
xmlns:trh="http://myfaces.apache.org/trinidad/html"
title="Base test">
<f:view>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" />
<title>RedMane Trinidad Test</title>
<ui:insert name="beforeLoadScripts" />
</head>
<tr:form
defaultCommand="#{defaultFormCommand != null ? defaultFormCommand : 'none'}"
id="mainForm">
<div id="header"><!-- HEADER MENU --> <ui:insert
name="headerMenu">
<ui:include src="headerMenu.xhtml" />
</ui:insert></div>
<div id="content">
<div id="menuContent">
<div id="logo">
<h1><a href="#">Your Logo</a></h1>
<h2><a href="http://www.redmane.com/">your link</a></h2>
</div>
<!-- LEFT SIDE MENU --> <ui:insert name="menu">
<ui:include src="menu.xhtml" />
</ui:insert></div>
<div id="bodyContent">
<div id="welcome"><!-- PAGE TITLE -->
<h2><ui:insert name="title">Default Page title</ui:insert></h2>
<!-- ERROR MESSAGES --> <tr:messages /> <!-- PAGE CONTENT --> <ui:insert
name="content">
<ui:include src="content.xhtml" />
</ui:insert></div>
</div>
</div>
<div style="height:20px;"/>
<!-- FOOTER -->
<ui:insert name="footer">
<ui:include src="footer.xhtml" />
</ui:insert>
</tr:form>
</f:view>
<ui:insert name="afterLoadScripts"/>
</tr:document>
/** THE PAGE **/
<tr:subform
xmlns:ui=http://java.sun.com/jsf/facelets
xmlns:f="http://java.sun.com/jsf/core"
xmlns:tr="http://myfaces.apache.org/trinidad">
<ui:composition template="/layout/layout.xhtml">
<ui:define name="title">Home Page</ui:define>
<ui:define name="content">
Welcome
<p>
<tr:group rendered="#{securityContext.ifAllGranted['ROLE_TEST']}">
Testing ACEGI JSF
</tr:group>
</p>
</ui:define>
</ui:composition>
</tr:subform>
/** END OF CODE **/
By simply refreshing this page, the IE keeps allocating more memory.
Since Firefox is behaving fine, I suppose it's an IE7 problem, so we cannot
do anything about it. I also made the same tests on maps.google.com (that
for what I know uses a lot of AJAX and Javascript) and it presents the same
behavior!
I'll maybe post something on an IE forum, but I don't expect a quick
solution to the problem (or any solution at all...) from Bill...
Thanks again
Davide
On Thu, Mar 27, 2008 at 10:54 AM, Volker Weber <v....@inexso.de> wrote:
> Hi Davide,
>
> did you use own javascript in your app?
>
> If you assign htmlNode objects to javascript object properties and/or
> vice versa the IE (at least IE6) did not correct free them on page
> unload. You need to remove this yourself by assigning undefined to
> those properties in the unload handler.
>
> We had a similar problem in tobago which we solved this way.
>
>
> Regards,
> Volker
>
> 2008/3/27, Davide Bonicelli <da...@gmail.com>:
> > 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 <ma...@oracle.com>
> 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
> > > >
> > >
> > >
> >
> >
>
>
> --
> inexso - information exchange solutions GmbH
> Bismarckstraße 13 | 26122 Oldenburg
> Tel.: +49 441 4082 356 |
> FAX: +49 441 4082 355 | www.inexso.de
>
Re: [Trinidad] Browser memory consumption
Posted by Volker Weber <v....@inexso.de>.
Hi Davide,
did you use own javascript in your app?
If you assign htmlNode objects to javascript object properties and/or
vice versa the IE (at least IE6) did not correct free them on page
unload. You need to remove this yourself by assigning undefined to
those properties in the unload handler.
We had a similar problem in tobago which we solved this way.
Regards,
Volker
2008/3/27, Davide Bonicelli <da...@gmail.com>:
> 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 <ma...@oracle.com> 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
> > >
> >
> >
>
>
--
inexso - information exchange solutions GmbH
Bismarckstraße 13 | 26122 Oldenburg
Tel.: +49 441 4082 356 |
FAX: +49 441 4082 355 | www.inexso.de
Re: [Trinidad] Browser memory consumption
Posted by Davide Bonicelli <da...@gmail.com>.
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 <ma...@oracle.com> 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 <ma...@oracle.com>
> 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
> > >
> >
> >
>
>
Re: [Trinidad] Browser memory consumption
Posted by Davide Bonicelli <da...@gmail.com>.
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 <ma...@oracle.com> 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
> >
>
>
Re: [Trinidad] Browser memory consumption
Posted by Max Starets <ma...@oracle.com>.
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
>