Description
Softly-referenced objects will be garbage-collected in a globally least-recently-used manner, in response to memory demand. Even though canonicalMap's value is soft referenced, key is strong referenced, key and value are referencing the same object. So traits in the cache will never be garbage-collected, which may cause OOM if we have tons of different traits.