[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/23952] New: java.util.ResourceBundle should use a more so
From: |
ray at shoudonet dot no-ip dot org |
Subject: |
[Bug classpath/23952] New: java.util.ResourceBundle should use a more sophisticated cache mechanism |
Date: |
18 Sep 2005 16:16:56 -0000 |
java.util.ResourceBundle.getBundle() uses an internal cache (java.util.HashMap)
to reuse already-instantiated bundle objects. However, HashMap does not have
any upper bound for memory usage, so it can cause severe memory consumption for
applications which create a lot of bundle objects.
For example, when starting Tomcat 5.0.28 on the CVS version of Kaffe, I observed
a linear increase in memory consumption [1], using Java Memory Profiler. This
is caused by org.apache.webapp.admin.ApplicationLocales.<init>(), which
instantiates several hundred PropertyResouceBundle objects. By modifying
getBundle() to disable the caching, I confirmed that there was no increase in
the heap size [2]. However, it increased the start-up time of Tomcat by 30 sec;
70 sec when using the cache, while 100 sec when not using the cache.
Overall, the best solution would be to use more sophisticated cache which can
remove less used bundles from itself.
[1] http://f.hatena.ne.jp/images/fotolife/r/rjj/20050919/20050919004130.png
[2] http://f.hatena.ne.jp/images/fotolife/r/rjj/20050919/20050919005408.png
--
Summary: java.util.ResourceBundle should use a more sophisticated
cache mechanism
Product: classpath
Version: 0.18
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ray at shoudonet dot no-ip dot org
CC: bug-classpath at gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23952
- [Bug classpath/23952] New: java.util.ResourceBundle should use a more sophisticated cache mechanism,
ray at shoudonet dot no-ip dot org <=