You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Henri Dupre <he...@gmail.com> on 2006/07/26 18:34:01 UTC

object pools and tapestry memory (solved I believe)

I put into production a "SoftPool" using hivemind and all the pages are
stored using SoftReferences in the page pool.
This change was very easy, there is a specific PagePool service in hivemind.

That far things are running very smoothly and the app hasn't climbed up to
95% of memory used (seems to run around 60% of mem).
And I believe I also understood the reason.
I discovered that tapestry dumps the size of the pagepool in exception pages
and we have tracks of all of them in emails... After a day of run, the pool
size was about 800 pages!
And the real funkyness here is that there was over 20 locales! I guess
people coming from search engines from all around the world and for each new
locale there is a new engine created + pages. The pages stored in the pool
are for a specific locale and so the more locales you have the larger the
pool is.

Also SoftReferences seem to really work the way you would expect it... The
pool is kept but when memory gets low, the pool size gets reduced. With weak
references, it is even possible to keep the memory very low... The app was
gc'ed down to 80m of heap but WeakReferences seem to be gc'ed too
agressively for a pool.
I'm going to experiment some more sophisticated strategies by removing
periodically pages that are not used often and I'll plug this pool for the
engine service also. I don't want to keep engines for a locale that
generates 1 visit a day or less...

If anyone is interested I can post my code and my jar file (I deployed this
change in a separate jar file).

-- 
Thanks,

Re: object pools and tapestry memory (solved I believe)

Posted by Hanna Haddad <hh...@lixar.com>.
Hi Henri, 

could you please post the source code for your softpool. I would like to
change tapestry default pool, but I am not familiar with the process.

Thank you.


Henri Dupre wrote:
> 
> I put into production a "SoftPool" using hivemind and all the pages are
> stored using SoftReferences in the page pool.
> This change was very easy, there is a specific PagePool service in
> hivemind.
> 
> That far things are running very smoothly and the app hasn't climbed up to
> 95% of memory used (seems to run around 60% of mem).
> And I believe I also understood the reason.
> I discovered that tapestry dumps the size of the pagepool in exception
> pages
> and we have tracks of all of them in emails... After a day of run, the
> pool
> size was about 800 pages!
> And the real funkyness here is that there was over 20 locales! I guess
> people coming from search engines from all around the world and for each
> new
> locale there is a new engine created + pages. The pages stored in the pool
> are for a specific locale and so the more locales you have the larger the
> pool is.
> 
> Also SoftReferences seem to really work the way you would expect it... The
> pool is kept but when memory gets low, the pool size gets reduced. With
> weak
> references, it is even possible to keep the memory very low... The app was
> gc'ed down to 80m of heap but WeakReferences seem to be gc'ed too
> agressively for a pool.
> I'm going to experiment some more sophisticated strategies by removing
> periodically pages that are not used often and I'll plug this pool for the
> engine service also. I don't want to keep engines for a locale that
> generates 1 visit a day or less...
> 
> If anyone is interested I can post my code and my jar file (I deployed
> this
> change in a separate jar file).
> 
> -- 
> Thanks,
> 
> 

-- 
View this message in context: http://www.nabble.com/object-pools-and-tapestry-memory-%28solved-I-believe%29-tf2004817.html#a7021445
Sent from the Tapestry - Dev mailing list archive at Nabble.com.


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


Re: object pools and tapestry memory (solved I believe)

Posted by D&J Gredler <dj...@gmail.com>.
Hmm... excuse me while I go tweak my .application file... ;-)

On 7/26/06, Howard Lewis Ship <hl...@gmail.com> wrote:
>
> For public sites, its really important to make use of
> org.apache.tapestry.accepted-locales configuration property.
>
>
> http://tapestry.apache.org/tapestry4/UsersGuide/localization.html#localization.accepted-locales
>
> On 7/26/06, Henri Dupre <he...@gmail.com> wrote:
> > I put into production a "SoftPool" using hivemind and all the pages are
> > stored using SoftReferences in the page pool.
> > This change was very easy, there is a specific PagePool service in
> hivemind.
> >
> > That far things are running very smoothly and the app hasn't climbed up
> to
> > 95% of memory used (seems to run around 60% of mem).
> > And I believe I also understood the reason.
> > I discovered that tapestry dumps the size of the pagepool in exception
> pages
> > and we have tracks of all of them in emails... After a day of run, the
> pool
> > size was about 800 pages!
> > And the real funkyness here is that there was over 20 locales! I guess
> > people coming from search engines from all around the world and for each
> new
> > locale there is a new engine created + pages. The pages stored in the
> pool
> > are for a specific locale and so the more locales you have the larger
> the
> > pool is.
> >
> > Also SoftReferences seem to really work the way you would expect it...
> The
> > pool is kept but when memory gets low, the pool size gets reduced. With
> weak
> > references, it is even possible to keep the memory very low... The app
> was
> > gc'ed down to 80m of heap but WeakReferences seem to be gc'ed too
> > agressively for a pool.
> > I'm going to experiment some more sophisticated strategies by removing
> > periodically pages that are not used often and I'll plug this pool for
> the
> > engine service also. I don't want to keep engines for a locale that
> > generates 1 visit a day or less...
> >
> > If anyone is interested I can post my code and my jar file (I deployed
> this
> > change in a separate jar file).
> >
> > --
> > Thanks,
> >
> >
>

Re: object pools and tapestry memory (solved I believe)

Posted by Henri Dupre <he...@gmail.com>.
On 7/26/06, Howard Lewis Ship <hl...@gmail.com> wrote:
>
> For public sites, its really important to make use of
> org.apache.tapestry.accepted-locales configuration property.
>
>
> http://tapestry.apache.org/tapestry4/UsersGuide/localization.html#localization.accepted-locales


Thanks Howard! This should cut down quite a bit the number of engines in
memory.

Henri.

RE: object pools and tapestry memory (solved I believe)

Posted by Kevin Menard <km...@servprise.com>.
> -----Original Message-----
> From: Jesse Kuhnert [mailto:jkuhnert@gmail.com]
> Sent: Wednesday, July 26, 2006 2:46 PM
> To: Tapestry development
> Subject: Re: object pools and tapestry memory (solved I believe)
> 
> Possibly an oversight, or it just seemed like the best "default
> configuration" that would please the greatest number of users.
> 
> It's certainly something that can be debated, though we wouldn't be able
> to
> change the defaults to what you suggested until at least tap 4.2 as there
> aren't any deprecation warnings in place yet.

Fair enough.  I think we should probably get some discussion going on it
though.  My guess is that the vast majority of Tapestry users are blissfully
unaware of this setting.  One could argue that all documentation should be
read, for sure.  But, if I have no plans to do localization, I'm not apt to
read the docs on it either *shrug*

Anyway, I'm glad I know about it now.

-- 
Kevin


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


Re: object pools and tapestry memory (solved I believe)

Posted by Jesse Kuhnert <jk...@gmail.com>.
Possibly an oversight, or it just seemed like the best "default
configuration" that would please the greatest number of users.

It's certainly something that can be debated, though we wouldn't be able to
change the defaults to what you suggested until at least tap 4.2 as there
aren't any deprecation warnings in place yet.

On 7/26/06, Kevin Menard <km...@servprise.com> wrote:
>
> > -----Original Message-----
> > From: Howard Lewis Ship [mailto:hlship@gmail.com]
> > Sent: Wednesday, July 26, 2006 12:41 PM
> > To: Tapestry development
> > Subject: Re: object pools and tapestry memory (solved I believe)
> >
> > For public sites, its really important to make use of
> > org.apache.tapestry.accepted-locales configuration property.
> >
> >
> http://tapestry.apache.org/tapestry4/UsersGuide/localization.html#localiza
> > tion.accepted-locales
>
> Hmm . . . I guess I missed that one.  It would seem to me that the default
> should be to limit resource usage and if one wishes to support multiple
> locales, then use a configuration item.  Is there any particular reason
> why
> this is not the case?
>
> --
> Kevin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.

RE: object pools and tapestry memory (solved I believe)

Posted by Kevin Menard <km...@servprise.com>.
> -----Original Message-----
> From: Howard Lewis Ship [mailto:hlship@gmail.com]
> Sent: Wednesday, July 26, 2006 12:41 PM
> To: Tapestry development
> Subject: Re: object pools and tapestry memory (solved I believe)
> 
> For public sites, its really important to make use of
> org.apache.tapestry.accepted-locales configuration property.
> 
> http://tapestry.apache.org/tapestry4/UsersGuide/localization.html#localiza
> tion.accepted-locales

Hmm . . . I guess I missed that one.  It would seem to me that the default
should be to limit resource usage and if one wishes to support multiple
locales, then use a configuration item.  Is there any particular reason why
this is not the case?

-- 
Kevin


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


Re: object pools and tapestry memory (solved I believe)

Posted by Howard Lewis Ship <hl...@gmail.com>.
For public sites, its really important to make use of
org.apache.tapestry.accepted-locales configuration property.

http://tapestry.apache.org/tapestry4/UsersGuide/localization.html#localization.accepted-locales

On 7/26/06, Henri Dupre <he...@gmail.com> wrote:
> I put into production a "SoftPool" using hivemind and all the pages are
> stored using SoftReferences in the page pool.
> This change was very easy, there is a specific PagePool service in hivemind.
>
> That far things are running very smoothly and the app hasn't climbed up to
> 95% of memory used (seems to run around 60% of mem).
> And I believe I also understood the reason.
> I discovered that tapestry dumps the size of the pagepool in exception pages
> and we have tracks of all of them in emails... After a day of run, the pool
> size was about 800 pages!
> And the real funkyness here is that there was over 20 locales! I guess
> people coming from search engines from all around the world and for each new
> locale there is a new engine created + pages. The pages stored in the pool
> are for a specific locale and so the more locales you have the larger the
> pool is.
>
> Also SoftReferences seem to really work the way you would expect it... The
> pool is kept but when memory gets low, the pool size gets reduced. With weak
> references, it is even possible to keep the memory very low... The app was
> gc'ed down to 80m of heap but WeakReferences seem to be gc'ed too
> agressively for a pool.
> I'm going to experiment some more sophisticated strategies by removing
> periodically pages that are not used often and I'll plug this pool for the
> engine service also. I don't want to keep engines for a locale that
> generates 1 visit a day or less...
>
> If anyone is interested I can post my code and my jar file (I deployed this
> change in a separate jar file).
>
> --
> Thanks,
>
>


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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