Reduce SchemaContext cache to weak values 44/12844/1
authorRobert Varga <rovarga@cisco.com>
Fri, 14 Nov 2014 13:32:06 +0000 (14:32 +0100)
committerRobert Varga <rovarga@cisco.com>
Fri, 14 Nov 2014 13:32:06 +0000 (14:32 +0100)
commita5d4b0e898e08a9f67311bc3e036d9abc8079df2
tree5d3fb106efa1de25cef180ff6ea3b4e9fc596439
parent2b2759df79c2837bc1ada2f720370d508480e01c
Reduce SchemaContext cache to weak values

While constructing a SchemaContext is potentially costly, we do not need
to retain them if they are not used for long periods of time. Soft
references attempt to retain the context until the memory pressure is
pretty high, while weak references are cleared as soon as the object is
proven to be weakly reachable.

Change-Id: I2df2a78218d3b439edadda2192ff541e4c1c0fee
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/SharedSchemaContextFactory.java