[MDSAL-580] ValueTypeCodec.STATIC_CODECS can prevent class unloading Created: 20/Jul/20  Updated: 21/Jul/20  Resolved: 21/Jul/20

Status: Resolved
Project: mdsal
Component/s: Binding runtime
Affects Version/s: None
Fix Version/s: 7.0.0, 4.0.17, 5.0.14, 6.0.4

Type: Bug Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

ValueTypeCodec.STATIC_CODECS is a cache of codecs which are not bound to a particular schema, but rather to a particular Class – i.e. they get everything they need from that class.

While the cache has weak keys, it does not use weak values – which would be fine, except it is populated by a number of ReflectionBasedCodecs, each of which retain a reference to the class – which ends up being problematic, as the strong value prevents garbage collection of the codec, which in turn prevents the class from getting unreachable.


Generated at Wed Feb 07 20:10:09 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.