Thanks for the quick response Antonio. I do have a quick and easy patch that works for our situation where we are not using Tiles for localization at all. I added an init parameter to disable localization and only use NULL_LOCALE whenever definitions are requested from CachingLocaleUrlDefinitionDAO. It would be nice to get this into the next 2.1 release so that we don't have to maintain our own custom version of the source. I haven't checked if the same patch could be merged in to the trunk as it is, but it's a pretty small change so it probably could. Shall I send the patch to you directly or is there a more appropriate place to send it?
I also attempted a more complete solution that modified CachingLocaleUrlDefinitionDAO to cache the definitions for all locales more efficiently by using the same objects when the is no localization instead of creating and storing a new identical object for each of them. It all looked good when unit testing it, but it didn't reduce the memory consumption when I ran it through our load tests and I couldn't figure out why... Pierre -----Original Message----- From: Antonio Petrelli [mailto:[email protected]] Sent: March-01-11 9:54 AM To: [email protected] Cc: Boudreau, Pierre Subject: Re: Tiles Cache Memory Usage 2011/3/1 Boudreau, Pierre <[email protected]>: > We are using Tiles 2.1.2 in our application and have noticed that it is > consuming a large portion of the memory we have available on our servers. > While analyzing a heap dump, we found out that most of this memory is held by > CachingLocaleUrlDefinitionDAO, which has a HashMap that holds a HashMap of > all tiles definitions for each locale. A separate copy of each definition is > held for each locale even if they are not localized. In the heap dump I > looked at, we had 115 identical copies of the tiles definitions at an average > of over 1 MB each. This was using over 150 MB of RAM when we only really > need over 1 MB since none of our definitions are localized. Is there a way > to configure Tiles to avoid this? Has this been improved in newer versions? I am sorry, there is no improvement in this. The problem is that CachingLocaleUrlDefinitionDAO caches, for each locale, the same definition copies for faster performance. It can be improved, but I cannot do it at present time. You can prepare a patch though :-) Antonio
