[midPoint] Possible memory leak in ExpressionFactory.cache and heavy memory allocation in general

Radovan Semancik radovan.semancik at evolveum.com
Fri Dec 22 09:36:55 CET 2017


On 12/21/2017 03:14 PM, Arnošt Starosta - AMI Praha a.s. wrote:
> There may be a memory leak 
> in com.evolveum.midpoint.repo.common.expression.ExpressionFactory.cache, 
> there are milions of Expressions cached there, see the attached 
> screenshot. I can only guess this is not the desired behavior, there 
> may a bug in ExpressionIdentifier.hashCode() or there is no eviction?

There is indeed no eviction. But, new expression should get into the 
cache only if expression code is changed. Which should be a very rare 
event in production environment. And development environments usually 
get restarted quite often, therefore we haven't run into any problems 
with this so far.
Making efficient cache eviction is not easy. Time-based eviction may 
impact performance or won't be efficient at all if we do not get the 
parameters right. Size-based eviction, LRU and so on may get a bit 
complex and the impact is questionable. Therefore we have decided to 
keep things simple here.

Still, there may be a bug that expressions are not properly reused from 
cache. Please use the usual channels to report a bug.

-- 
Radovan Semancik
Software Architect
evolveum.com




More information about the midPoint mailing list