Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
Release Branch 4.0, Trunk
-
None
-
Linux, JDK 1.5_15, Xmx set to 1156Mo
Description
In our production system, we had an OutOfMemoryError.
I analyzed the generated Heap Dump and found the following:
The cache entitycache.entity-list.default.ProductCategoryMember retains a heap of 369314128 Bytes.
The LRUMap hold by this object is occupying this space (369314128) and this object has a stange state:
- maxSize is set to 5000 (as set in the cache.properties)
- size is 128930 => PROBLEM
IN cache.properties:
entitycache.entity-list.default.ProductCategoryMember.expireTime=3600000
entitycache.entity-list.default.ProductCategoryMember.useSoftReference=true
entitycache.entity-list.default.ProductCategoryMember.maxInMemory=5000
entitycache.entity-list.default.ProductCategoryMember.maxSize=7500
I analyzed the code of LRUMap and its usage in CacheLineTable and IMHO the bug is a missing synchonized in get():
public CacheLine<V> get(Object key) {
if (key == null)
return getNoCheck(key);
}
Since LRUMap extends LinkedHashMap, if you look at get method, it changes the state of the Map by calling e.recordAccess(this):
public V get(Object key)
So the default of synchronization corrupts the state of LRUMap which grows indefinitely
I will submit a patch for this on the trunk.
Philippe
www.ubik-ingenierie.com
Attachments
Attachments
Issue Links
- is blocked by
-
OFBIZ-2124 Ofbiz freeze
- Closed