[GENIUS-90] Suspected memory leak in InterfacemgrProvider Created: 07/Sep/17  Updated: 22/Jan/20

Status: Open
Project: genius
Component/s: General
Affects Version/s: Carbon
Fix Version/s: None

Type: Improvement
Reporter: Michael Vorburger Assignee: Karthika Panneer
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All



 Description   

HPROF analysis with MAT in the context of CONTROLLER-1756 is showing 4 MB used up in org.opendaylight.genius.interfacemanager.InterfacemgrProvider, at a stage when (according to Sridhar/Sai) the system should be "at rest" - so this looks suspicious.. so I'm guessing something is probably not really done right there.

Now 4 MB is not huge in the large scale of things, so this isn't a Blocker, but it still doesn't look quite right that in a "Dominator Tree" in MAT after a lot of cluster related shit this class (only, nothing else in genius or anywhere in netvirt) does visibly stick out as consuming a surprising amount of memory - it should, ideally, not hold on to permanent state (whatever it is) like this?

In theory, I suspect that this would over time, gradually and slowly, probably cause OOMs. Not sure under what exact conditions (lots and lots of interfaces?), but if we have some unbound Map or whatever somewhere in there, it would be good to have a look at it (PERHAPS using a real [infrautils] Cache, instead of a Map; if that's it).



 Comments   
Comment by Michael Vorburger [ 07/Sep/17 ]

> if we have some unbound Map or whatever somewhere in there,

Yeah that's the problem here - on spending a few more minutes staring at MAT, I can clearly see that of the said 4 MB most is in 2 of the 3 ConcurrentHashMap (dunno which 2 of the 3, and does not matter).

> (instead) using a real [infrautils] Cache, instead of a Map

That would be the right thing to do here. It's not super trivial (else I would have just done it now!) because InterfacemgrProvider's logic has explicit remove methods for entries in 3 Maps, so converting that to be a real Cache instead needs a bit more thought, together with someone who knows that that code is actually doing.

Comment by Michael Vorburger [ 29/Nov/17 ]

thapar is https://git.opendaylight.org/gerrit/#/c/65188/ the fix for this? I've ignored it so far because it did not have a +1 - is it final and should I be reviewing it?

Generated at Wed Feb 07 19:59:53 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.