[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 19:05:14 CET 2017
I think i got one half of it. The key in ExpressionFactory.cache was
breaking the hashCode-equals contract,
because LayeredRefinedAttributeDefinitionImpl breaks it by calling
super.hashCode() and super happens to be ... java.lang.Object returning a
magic number for every instance.
Please see https://github.com/Evolveum/midpoint/pull/60
Would still like to hear some comment on the second half - all users with
their xml detail in a single result set in memory. Any idea where this may
be comming from?
thanks
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/bb306035/attachment.htm>
More information about the midPoint
mailing list