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

Eliminate duplicate DescriptionEffectiveStatementImpl objects

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Highest Highest
    • 7.0.0
    • None
    • None
    • None
    • Operating System: All
      Platform: All

      Analysis of a memory snapshot with vendor models shows we end up with a SchemaContext which weighs about 240MB. Further analysis of duplicate objects shows we have ~4000 instances of DescriptionEffectiveStatementImpl wasting ~400kB, which refer to a single description statement defined in a grouping.

      This hints at us not having the understanding that a statement has been copied and unmodified from a grouping. Analyze the exact cause for this and fix it either by not performing a copy, or squashing resulting duplicates.

      This theory is reinforced by the fact that the same dump shows ~64K WhenEffectiveStatementImpl objects (23x groups of 2769 instances each) coming from a construct like:

      grouping foo {
        leaf bar {
          when "../x";
        }
      }
      

      A similar situation happens with UnitsEffectiveStatementImpl – 15K instances wasting 450kB.

        1. heap.bin
          8.88 MB
        2. image-2020-12-03-18-31-00-574.png
          image-2020-12-03-18-31-00-574.png
          458 kB
        3. image-2020-12-03-18-56-27-486.png
          image-2020-12-03-18-56-27-486.png
          583 kB
        4. Screen Shot 2019-08-14 at 12.46.25.png
          Screen Shot 2019-08-14 at 12.46.25.png
          54 kB
        5. Screen Shot 2019-08-15 at 10.07.46.png
          Screen Shot 2019-08-15 at 10.07.46.png
          186 kB
        6. yt694-dups.png
          yt694-dups.png
          137 kB

            miro.kovac Miroslav Kovac
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: