You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jochen Berger <fo...@googlemail.com> on 2010/03/22 16:36:09 UTC

Possible memory leak in zone update?

Hi,

I am currently writing a webapp with tapestry 5 and have come to a point
where I want a zone to be updated regularly. That works quite well using
just a small amount of custom JavaScript. However, I noticed that the
browser's memory seems to fill up over the time.
The application updates two zones with multiple grids, some of them
again wrapping their cell content in event links that can be used to
filter the grid. The zones are updated every 15 seconds. When leaving
the page open overnight, the browser is nearly unusable the next day.
I tried to strip my own Javascript down and rely mostly on what's
provided by tapestry, tried to set several variables (including the
links' _tapestry.zoneManager) to null before updating the zone content,
but all to no avail.
The problem can be reproduced on multiple browsers, such as FF 3.6,
Safari 4.0.5 and Chrome 4.1.
So finally I tried to put up a simple webapp with just one page and one
grid with fake data and a simple JS that "clicks" one of the sorting or
paging links every 0.5 seconds. In fact, I overrode
Tapestry.Initializer.linkZone to observe a custom event that I fire from
my JS. The webapp's source is available as zip file from [1].
Maybe someone has an idea what I'm doing wrong, how I could prevent the
memory from being wasted or maybe someone could suggest a method to find
out where the memory is going. I was not able to find a tool to show me
an overview over what objects the browser holds in memory.
Any help is highly appreciated.

Regards,
Jochen

[1] http://www.file-upload.net/download-2369007/zonetest.zip.html


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


Re: Possible memory leak in zone update?

Posted by Massimo Lusetti <ml...@gmail.com>.
On Mon, Mar 22, 2010 at 5:28 PM, Andreas Andreou <an...@di.uoa.gr> wrote:

> Chrome's Developer Tools (ctrl+shift+i) have a "profiles" tab.
> Once selected, you'll find a "Take heap snapshot" at the bottom...
> press it once at the start, then again at the end of the activity
> you want to perform and it'll show you what changed

[OT] Chrome is already by far superior to Firefox/Firebug and is very addictive!

-- 
Massimo
http://meridio.blogspot.com

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


Re: Possible memory leak in zone update?

Posted by Jochen Berger <fo...@googlemail.com>.
Andreas,

sorry for not responding for so long, but I have been busy with a lot of
other stuff.

Andreas Andreou wrote:
> Chrome's Developer Tools (ctrl+shift+i) have a "profiles" tab.
> Once selected, you'll find a "Take heap snapshot" at the bottom...
> press it once at the start, then again at the end of the activity
> you want to perform and it'll show you what changed

Thanks a lot for the hint. I have tried the developer tools but only
came to the conclusion that something is leaking memory, which didn't
get me very far.
I also spent some days with trying tapestry 5.2, hacking tapestry.js,
trying to rephrase bits of code that looked suspicious to me, but
without much success. Today I also tried the new prototype RC, but the
results were comparable to the 1.6.1 one.
Today I stumbled upon a ticket in the prototype bugtracker [1], and
after applying parts of the appended patch and playing around, I am now
sure, that it is definitely related.
Unfortunately, that patch increases the CPU usage considerably, mostly
due to the CACHE=CACHE.without(element) line.
I haven't yet made up my mind whether to completely remove the CACHE
parts (which seem to be needed for IE only, which I don't care about for
that project) or spend more time to find a better way, but I thought I'd
share my findings.

Regards,
Jochen

[1] https://prototype.lighthouseapp.com/projects/8886/tickets/466


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


Re: Possible memory leak in zone update?

Posted by Andreas Andreou <an...@di.uoa.gr>.
Chrome's Developer Tools (ctrl+shift+i) have a "profiles" tab.
Once selected, you'll find a "Take heap snapshot" at the bottom...
press it once at the start, then again at the end of the activity
you want to perform and it'll show you what changed

On Mon, Mar 22, 2010 at 17:36, Jochen Berger <fo...@googlemail.com> wrote:
> Hi,
>
> I am currently writing a webapp with tapestry 5 and have come to a point
> where I want a zone to be updated regularly. That works quite well using
> just a small amount of custom JavaScript. However, I noticed that the
> browser's memory seems to fill up over the time.
> The application updates two zones with multiple grids, some of them
> again wrapping their cell content in event links that can be used to
> filter the grid. The zones are updated every 15 seconds. When leaving
> the page open overnight, the browser is nearly unusable the next day.
> I tried to strip my own Javascript down and rely mostly on what's
> provided by tapestry, tried to set several variables (including the
> links' _tapestry.zoneManager) to null before updating the zone content,
> but all to no avail.
> The problem can be reproduced on multiple browsers, such as FF 3.6,
> Safari 4.0.5 and Chrome 4.1.
> So finally I tried to put up a simple webapp with just one page and one
> grid with fake data and a simple JS that "clicks" one of the sorting or
> paging links every 0.5 seconds. In fact, I overrode
> Tapestry.Initializer.linkZone to observe a custom event that I fire from
> my JS. The webapp's source is available as zip file from [1].
> Maybe someone has an idea what I'm doing wrong, how I could prevent the
> memory from being wasted or maybe someone could suggest a method to find
> out where the memory is going. I was not able to find a tool to show me
> an overview over what objects the browser holds in memory.
> Any help is highly appreciated.
>
> Regards,
> Jochen
>
> [1] http://www.file-upload.net/download-2369007/zonetest.zip.html
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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