This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Usage of Resource Bundles and Memory consumption

 
sopal Pal
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
When we use resource bundles, does all the contents of a given resource bundle gets loaded into memory or do they get loaded only as and when used.
I was wondering, if defining multiple Resource Bundles for different parts of an application would reduce the memory consumption.
Please let me know.
Thanks
Sumit
 
brad balmer
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm assuming you mean using a ResourceBundle to read in a propery file and if the entire property file is read in at one time?
 
sopal Pal
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that is what I wanted to know.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, the entire file is read in at once.
For performance reasons you might therefore want to declare them as static and/or use a Singleton pattern to access them.
Something like the stuff Eclipse generates for you when you externalise Strings from an application would do nicely:
 
sopal Pal
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thanks for your valuable input.
So when is the file read - when the first Key is Read ??
Sumit
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic