Use soft values in ValueTypeCodec 98/91498/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:15 +0000 (10:43 +0200)
commit556641331b6bf179de5d1ff9cab3e38ac46d53ff
tree47514e88b183d4881f58337ae5c8ca4b70bd5c7a
parenta5e27ad9ed6674dae62007d004e751d35b4b2134
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