Use soft values in ValueTypeCodec 95/91495/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:42:45 +0000 (10:42 +0200)
commit0150ddd6c4e3c61a761dacb9161e84b3f38b748a
tree1534f28e6d18ee829c873298b1e3e32cb4e20ee4
parent7f453ef5095fccba4c63d2bb7eb298d3e97e028b
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>
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/ValueTypeCodec.java