Description
As noted in YANGTOOLS-490, we should be able to reduce our memory footprint by storing child leaves in a 'naked' format, i.e. we would store only the leaf value and allocate a LeafNode each time it is accessed.
While this can end up putting some pressure on TLAB allocations, an OFP heap dump is showing that retained LeafNodes are costing us ~155MiB out of 855MiB (i.e. 19%) in 6.8 million (21%) objects.
Given that we keep leaves in a Map, we always know the NodeIdentifier of the leaf, i.e. we would have a Map.Entry<NodeIdentifier, Object>, which has all the information needed to reconstruct the leaf.
Some thought needs to be put into NormalizedNode.getValue(), as that currently operates on Map.values() and will have to operate on Map.entrySet().
Attachments
Issue Links
- relates to
-
YANGTOOLS-490 Create SchemaContext-aware NormalizedNodes
- Confirmed