velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raymond Auge <ra...@liferay.com>
Subject Re: velocimarco.library property and StringResourceLoader
Date Thu, 08 Jan 2009 17:35:10 GMT
On Thu, 2009-01-08 at 08:53 -0800, Nathan Bubna wrote:

> On Thu, Jan 8, 2009 at 6:39 AM, Raymond Auge <rauge@liferay.com> wrote:
> ...
> > I do have a question of my own. How many strings in the repository is
> > too many? Or an overall size. Can they have a time-to-live?
> ...
> 
> There is currently no limit besides the available memory.   There's
> also no expiry for them.  StringResourceRepositoryImpl just uses a
> synchronized hashmap to store StringResource instances.   But
> StringResourceRepository is an interface, so fancier implementations
> are possible.  

And yet, you would really lose the performance benefit if you were to
drop them into some slower storage than memory, where you would have to
serialize them again, anyway... so that being the case... perhaps using
an LRU cache with a max size could be the solution to not killing memory
with tones of random VTL strings.



> You would just have to set the
> string.resource.loader.repository.class property or manually set the
> repo via:
> 
> StringResourceLoader.setRepository(StringResourceLoader.REPOSITORY_NAME_DEFAULT,
> myStringResourceRepo);

Cool!

--
Raymond Augé
Senior Software Engineer
Liferay, Inc.
Enterprise. Open Source. For Life.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message