Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1019

Lazily-instantiated LeafNodes

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • 4.0.0
    • data-impl
    • None

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              rovarga Robert Varga
              rovarga Robert Varga
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: