Open GoogleCodeExporter opened 9 years ago
Bumped into the same issue. After analyzing the heap dump we found the problem:
On each construction of a BasicDAO it calls "initType" which calls
"addMappedClass" on the mapper itself. Which is valid from our point of view.
The mapper manages all mapped classes in its mappedClasses and
mappedClassesByCollection collections. The memory leak occurs in Mapper:170,
when MappedClass instances are added to sets in mappedClassesByCollection
("mcs.add(mc)"). We got millions of entries in the sets of
mappedClassesByCollection values.
Solution:
1) Override the hashCode method of MappedClass. Suggestion: return
clazz.hashCode()
2) Make the mapper check if a Class is mapped already. Currently using BasicDAO
it reflects and analyzes the entity class on each construction
Original comment by juri.ku...@gmail.com
on 21 Jan 2013 at 2:20
Original issue reported on code.google.com by
m...@thelevines.com
on 3 Mar 2012 at 1:14