You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Taha Hafeez <ta...@gmail.com> on 2011/07/04 05:36:01 UTC

Zone might result in memory leak

Hi

While working on the Zone-refresh component, I was testing it on IE8 and
found that it resulted in memory leak... After working on it the whole day I
couldn't get around it.

Finally I disabled the timer and used fast manual clicks to check if the
problem was with the zone itself. What I found was that if I return
zone.getBody() then there is no memory leak but if I return zone then there
is a constant leak of memory.

I might be wrong but this was my 4:30 in the morning to 12:10 at night
conclusion (that too on a Sunday)

The test is this

1. create a eventlink and link it to a zone.
2. return Zone from event handler and see the memory usage
3. return zone.getBody() from event handler and see the memory usage

I pray I am not wrong otherwise it will to total waste of my sunday

regards
Taha

Re: Zone might result in memory leak

Posted by Nikla Ratinen <ni...@gmail.com>.
Hi,

Afaik, zone div contents is replaced by whatever server side returns 
from event handler method.
That is, if you return a zone Tapestry will faithfully replace zone 
contents with a copy of original zone...
after all, you could return a completely different zone than the 
original one.

Refresh will then keep nesting zones and the dom will just get bigger 
all the time.

If you observe dom in eg. firebug when link in below is clicked 
consecutively
it just keeps getting added to with every click.

<div t:id="zone1">
     <a t:type="eventlink" t:id="update1" zone="^">Update</a>
</div>

@Component private Zone zone1;

@OnEvent("update1")
Object update1()
{
     return zone1;
}


Cheers,
--Nikla




On 4.7.2011 6:36, Taha Hafeez wrote:
> Hi
>
> While working on the Zone-refresh component, I was testing it on IE8 and
> found that it resulted in memory leak... After working on it the whole day I
> couldn't get around it.
>
> Finally I disabled the timer and used fast manual clicks to check if the
> problem was with the zone itself. What I found was that if I return
> zone.getBody() then there is no memory leak but if I return zone then there
> is a constant leak of memory.
>
> I might be wrong but this was my 4:30 in the morning to 12:10 at night
> conclusion (that too on a Sunday)
>
> The test is this
>
> 1. create a eventlink and link it to a zone.
> 2. return Zone from event handler and see the memory usage
> 3. return zone.getBody() from event handler and see the memory usage
>
> I pray I am not wrong otherwise it will to total waste of my sunday
>
> regards
> Taha
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Zone might result in memory leak

Posted by Taha Hafeez <ta...@gmail.com>.
Hi

I just opened the task manager to see the usage to iexplorer process and it
starts increasing by 3 - 80k for each refresh based on the size of the page

In chrome, firefox & opera everything seems ok

regards
Taha


On Mon, Jul 4, 2011 at 10:13 AM, Josh Canfield <jo...@gmail.com>wrote:

> What do you use for memory profiling in IE?
> On Jul 3, 2011 8:36 PM, "Taha Hafeez" <ta...@gmail.com> wrote:
> > Hi
> >
> > While working on the Zone-refresh component, I was testing it on IE8 and
> > found that it resulted in memory leak... After working on it the whole
> day
> I
> > couldn't get around it.
> >
> > Finally I disabled the timer and used fast manual clicks to check if the
> > problem was with the zone itself. What I found was that if I return
> > zone.getBody() then there is no memory leak but if I return zone then
> there
> > is a constant leak of memory.
> >
> > I might be wrong but this was my 4:30 in the morning to 12:10 at night
> > conclusion (that too on a Sunday)
> >
> > The test is this
> >
> > 1. create a eventlink and link it to a zone.
> > 2. return Zone from event handler and see the memory usage
> > 3. return zone.getBody() from event handler and see the memory usage
> >
> > I pray I am not wrong otherwise it will to total waste of my sunday
> >
> > regards
> > Taha
>

Re: Zone might result in memory leak

Posted by Josh Canfield <jo...@gmail.com>.
What do you use for memory profiling in IE?
On Jul 3, 2011 8:36 PM, "Taha Hafeez" <ta...@gmail.com> wrote:
> Hi
>
> While working on the Zone-refresh component, I was testing it on IE8 and
> found that it resulted in memory leak... After working on it the whole day
I
> couldn't get around it.
>
> Finally I disabled the timer and used fast manual clicks to check if the
> problem was with the zone itself. What I found was that if I return
> zone.getBody() then there is no memory leak but if I return zone then
there
> is a constant leak of memory.
>
> I might be wrong but this was my 4:30 in the morning to 12:10 at night
> conclusion (that too on a Sunday)
>
> The test is this
>
> 1. create a eventlink and link it to a zone.
> 2. return Zone from event handler and see the memory usage
> 3. return zone.getBody() from event handler and see the memory usage
>
> I pray I am not wrong otherwise it will to total waste of my sunday
>
> regards
> Taha

Re: Zone might result in memory leak

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 04 Jul 2011 08:20:01 -0300, Taha Hafeez <ta...@gmail.com>  
wrote:

> Hi Thiago

Hi!

> I learned it the very hard way but am not sure why this happens

I guess this happens because the Zone JavaScript logic is executed once  
when the page is rendered. When the Zone is updated, if you return the  
whole Zone, I guess this JavaScript logic is executed again. When you  
return just the Zone body, this logic isn't executed.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Zone might result in memory leak

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 04 Jul 2011 00:36:01 -0300, Taha Hafeez <ta...@gmail.com>  
wrote:

> Hi

Hi!

> Finally I disabled the timer and used fast manual clicks to check if the
> problem was with the zone itself. What I found was that if I return
> zone.getBody() then there is no memory leak but if I return zone then  
> there is a constant leak of memory.

You shouldn't return the Zone instance itself anyway. zone.getBody() is  
the correct value to return.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org