Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.2-RC2
-
Component/s: referencing
-
Labels:None
-
Environment:Windows XP SP2, JDK 1.5.0_06, JBoss 4.0.4-GA
Description
The problem is one line the this method in
org.geotools.referencing.factory.BufferedAuthorityFactory:
private void put(final Object key, final Object object) {
pool.put(key, object);
// TODO fixed this line
int toReplace = maxStrongReferences - pool.size(); // here is the problem
if (toReplace > 0)
}
This line should be
int toReplace = pool.size() - maxStrongReferences;
With the current code, if maxStrongReferences = 100 and pool.size() = 20, up to 80 entries in the pool will be overwritten with WeakReferences, resulting in nearly no caching.
And while you're at it, could you please give
org.geotools.referencing.factory.epsg.DefaultFactory
a constructor that lets me set the buffer size in the BufferedAuthorityFactory?
Issue Links
- relates to
-
GEOT-932
Consider using LRULinkedHashMap for building pools in the Referencing module.
-
waiting for Martin's feedback before porting to trunk