Fix memory leak in BA mount service 98/81898/2
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 5 May 2019 18:15:19 +0000 (20:15 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 6 May 2019 08:05:22 +0000 (08:05 +0000)
commit8ae89c54f8019f53327001d1b916a53963097b34
tree411c2efac8607478479fa75eb455a0791507c9dc
parent0b7425d723d1e2365467ae910bced30c15dc4746
Fix memory leak in BA mount service

The cache used in BA mount service uses weakKeys() so the keys
(DOM mountpoint) could be GCed when no except cache, referenced
them).

However the values in the cache (BA mountpoint) also kept a reference
to the key, so the key was never weakly reachable and thus never GCed
resulting in a memory leak.

This is especially visible in case of frequent reconnects of netconf
mountpoints where after every reconnect a new DOM mountpoint is
created, requiring a new BA mountpoint creating new entry in the
cache of BA mount service.

This patch updates the entire suite of adapters, as it is shared
across all instances.

Change-Id: I9c109dd6d499d6185842d6a1ad5a59d75565af5c
Signed-off-by: Maros Marsalek <mmarsalek@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-adapter/src/main/java/org/opendaylight/mdsal/binding/dom/adapter/AbstractBindingLoadingAdapter.java