You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Yuri Ushakov <yu...@gmail.com> on 2009/03/17 15:59:07 UTC

Memory consumption

Hello.
I'm using Tapestry 5.0.18. I've been doing a load test using 10 concurrent
users (never more than 10 parallel requests). I've set up page pool to 10
pages also. I checked it - if 11th user comes, there is the tapestry
exception about hard-limit. So, the Tomcat is run with -Xmx2048M. The ten
users were browsing 4 particular pages for about 40 - 50 minutes. They are
quite ordinary pages, some small, one big (kinda user dashboard).

What I get is constant 85% heap usage with:

196 instances of PageImpl
308277 instances of ComponentPageElementImpl

Here is the profiler screenshot:
http://img19.imageshack.us/img19/6170/tapestrymemory.png

Questions are:

1. Why there is about 1G of retained CPEI objects.

2. Why there are 196 PageImpl objects, with page pool set to 10, and only 4
pages in use.

3. Where can I look for any clues? Enable some tapestry debugging? Read some
important document explaining this situation?

Thanks for any help.

Yuri.

Re: Memory consumption

Posted by Yuri Ushakov <yu...@gmail.com>.
Figured out what was wrong. It *was* so much components per page, actually.
We have this page, user dashboard, and a dozen pagelinks within it. Each
pagelink fully loaded the page it was pointing to, causing that page to load
its components in turn, etc. I modified CPEI and PageImpl to be able to look
into the inner structure of components, and printed the loaded hierarchy of
components on the screen, for our dashboard page. It showed total 17 page
objects and around 30k components. Some of those components were layouts,
rather "heavy" objects in retained size (megabytes). So, for example, 10
dashboard pages in the page pools were easily taking 100 megabytes of heap.
And that's only for dashboard.
Anyway, it has all gone away in Tapestry 5.1. Only 2 pages now with about 3k
component objects for the dashboard, and it's much faster.

Thanks!

2009/3/17 Howard Lewis Ship <hl...@gmail.com>

> Doesn't add up, that's right:  it should be 4 page classes X 10 (page
> pool size) X L (number of supported locales) maximum.
>
> This number will shift slightly if you use BeanEditor or Grid
> components, but it still doesn't add up.
>
> The count of CPEI seems high; you don't have 1500 components per page.
>
> One possibility here is that the bytecode manipulation that Tapestry
> does is confusing your profiler.
>
>
> On Tue, Mar 17, 2009 at 7:59 AM, Yuri Ushakov <yu...@gmail.com>
> wrote:
> > Hello.
> > I'm using Tapestry 5.0.18. I've been doing a load test using 10
> concurrent
> > users (never more than 10 parallel requests). I've set up page pool to 10
> > pages also. I checked it - if 11th user comes, there is the tapestry
> > exception about hard-limit. So, the Tomcat is run with -Xmx2048M. The ten
> > users were browsing 4 particular pages for about 40 - 50 minutes. They
> are
> > quite ordinary pages, some small, one big (kinda user dashboard).
> >
> > What I get is constant 85% heap usage with:
> >
> > 196 instances of PageImpl
> > 308277 instances of ComponentPageElementImpl
> >
> > Here is the profiler screenshot:
> > http://img19.imageshack.us/img19/6170/tapestrymemory.png
> >
> > Questions are:
> >
> > 1. Why there is about 1G of retained CPEI objects.
> >
> > 2. Why there are 196 PageImpl objects, with page pool set to 10, and only
> 4
> > pages in use.
> >
> > 3. Where can I look for any clues? Enable some tapestry debugging? Read
> some
> > important document explaining this situation?
> >
> > Thanks for any help.
> >
> > Yuri.
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Memory consumption

Posted by Howard Lewis Ship <hl...@gmail.com>.
I've done a cursory investigation using YourKit and I'm not seeing any
unexpected results. Number of PageImpl, ComponentPageElementImpl
instances are reasonable (for the testing I did).

On Tue, Mar 17, 2009 at 8:09 AM, Howard Lewis Ship <hl...@gmail.com> wrote:
> Doesn't add up, that's right:  it should be 4 page classes X 10 (page
> pool size) X L (number of supported locales) maximum.
>
> This number will shift slightly if you use BeanEditor or Grid
> components, but it still doesn't add up.
>
> The count of CPEI seems high; you don't have 1500 components per page.
>
> One possibility here is that the bytecode manipulation that Tapestry
> does is confusing your profiler.
>
>
> On Tue, Mar 17, 2009 at 7:59 AM, Yuri Ushakov <yu...@gmail.com> wrote:
>> Hello.
>> I'm using Tapestry 5.0.18. I've been doing a load test using 10 concurrent
>> users (never more than 10 parallel requests). I've set up page pool to 10
>> pages also. I checked it - if 11th user comes, there is the tapestry
>> exception about hard-limit. So, the Tomcat is run with -Xmx2048M. The ten
>> users were browsing 4 particular pages for about 40 - 50 minutes. They are
>> quite ordinary pages, some small, one big (kinda user dashboard).
>>
>> What I get is constant 85% heap usage with:
>>
>> 196 instances of PageImpl
>> 308277 instances of ComponentPageElementImpl
>>
>> Here is the profiler screenshot:
>> http://img19.imageshack.us/img19/6170/tapestrymemory.png
>>
>> Questions are:
>>
>> 1. Why there is about 1G of retained CPEI objects.
>>
>> 2. Why there are 196 PageImpl objects, with page pool set to 10, and only 4
>> pages in use.
>>
>> 3. Where can I look for any clues? Enable some tapestry debugging? Read some
>> important document explaining this situation?
>>
>> Thanks for any help.
>>
>> Yuri.
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: Memory consumption

Posted by Howard Lewis Ship <hl...@gmail.com>.
Doesn't add up, that's right:  it should be 4 page classes X 10 (page
pool size) X L (number of supported locales) maximum.

This number will shift slightly if you use BeanEditor or Grid
components, but it still doesn't add up.

The count of CPEI seems high; you don't have 1500 components per page.

One possibility here is that the bytecode manipulation that Tapestry
does is confusing your profiler.


On Tue, Mar 17, 2009 at 7:59 AM, Yuri Ushakov <yu...@gmail.com> wrote:
> Hello.
> I'm using Tapestry 5.0.18. I've been doing a load test using 10 concurrent
> users (never more than 10 parallel requests). I've set up page pool to 10
> pages also. I checked it - if 11th user comes, there is the tapestry
> exception about hard-limit. So, the Tomcat is run with -Xmx2048M. The ten
> users were browsing 4 particular pages for about 40 - 50 minutes. They are
> quite ordinary pages, some small, one big (kinda user dashboard).
>
> What I get is constant 85% heap usage with:
>
> 196 instances of PageImpl
> 308277 instances of ComponentPageElementImpl
>
> Here is the profiler screenshot:
> http://img19.imageshack.us/img19/6170/tapestrymemory.png
>
> Questions are:
>
> 1. Why there is about 1G of retained CPEI objects.
>
> 2. Why there are 196 PageImpl objects, with page pool set to 10, and only 4
> pages in use.
>
> 3. Where can I look for any clues? Enable some tapestry debugging? Read some
> important document explaining this situation?
>
> Thanks for any help.
>
> Yuri.
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: Memory consumption

Posted by Robert Zeigler <ro...@scazdl.org>.
This really sounds like something specific to your setup, either your  
app or your profile (are you holding onto page references somewhere?).

I have an app with 10-20 pages that has run with no memory issues for  
months on end, running with 512Mb max memory.  Any memory issues in  
the app have been mine, dealing a couple of tables that have upwards  
of a million records each.  Definitely not seeing anything like what  
you describe.

Robert

On Mar 17, 2009, at 3/179:59 AM , Yuri Ushakov wrote:

> Hello.
> I'm using Tapestry 5.0.18. I've been doing a load test using 10  
> concurrent
> users (never more than 10 parallel requests). I've set up page pool  
> to 10
> pages also. I checked it - if 11th user comes, there is the tapestry
> exception about hard-limit. So, the Tomcat is run with -Xmx2048M.  
> The ten
> users were browsing 4 particular pages for about 40 - 50 minutes.  
> They are
> quite ordinary pages, some small, one big (kinda user dashboard).
>
> What I get is constant 85% heap usage with:
>
> 196 instances of PageImpl
> 308277 instances of ComponentPageElementImpl
>
> Here is the profiler screenshot:
> http://img19.imageshack.us/img19/6170/tapestrymemory.png
>
> Questions are:
>
> 1. Why there is about 1G of retained CPEI objects.
>
> 2. Why there are 196 PageImpl objects, with page pool set to 10, and  
> only 4
> pages in use.
>
> 3. Where can I look for any clues? Enable some tapestry debugging?  
> Read some
> important document explaining this situation?
>
> Thanks for any help.
>
> Yuri.


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