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

Arnošt Starosta - AMI Praha a.s. arnost.starosta at ami.cz
Fri Dec 22 16:24:06 CET 2017


Hi Rado,

thanks for the comments, will report a bug or patch.

To fix this for the moment i replaced the HashMap cache implementation with
apache ReferenceMap which makes the entries accessible to garbage collector.

arnost

2017-12-22 9:36 GMT+01:00 Radovan Semancik <radovan.semancik at evolveum.com>:

> 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
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>



-- 

Arnošt Starosta
solution architect

gsm: [+420] 603 794 932
e-mail: arnost.starosta at ami.cz


AMI Praha a.s.
Pláničkova 11
162 00 Praha 6
tel.: [+420] 274 783 239
web: www.ami.cz


[image: AMI Praha a.s.]

[image: AMI Praha a.s.]
<http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management>

Textem tohoto e-mailu podepisující neslibuje uzavřít ani neuzavírá za
společnost AMI Praha a.s.
jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně
písemnou formu.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20171222/3ca72a5b/attachment.htm>


More information about the midPoint mailing list