Use soft values in ValueTypeCodec 96/91496/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 21 Jul 2020 08:39:32 +0000 (10:39 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 21 Jul 2020 08:43:25 +0000 (10:43 +0200)
commitccdf5e98a44d44baa1d508190c0669f981d0f2f1
tree9bbe15efb9f7754f1dafbf4290908d3134dd00a6
parentfc6fdd63a4f785078dca9e9198266ec967b690f7
Use soft values in ValueTypeCodec

Using strong value references in STATIC_CODECS cache leads to target
classes being strongly reachable through the codec itself -- hence
they will never be weakly reachable, hence they will not be GC'd.

Use soft values, which allows the classes to be GC'd as soon as the
JVM decides they have not been used for a while -- which is what
will happen when a class becomes almost-eligible for unloading.

JIRA: MDSAL-580
Change-Id: I7956d564c46a9a1d52ba85fbe61f3a19c507a902
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0150ddd6c4e3c61a761dacb9161e84b3f38b748a)
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/ValueTypeCodec.java