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

Improve model.api.ValueRange$Range usage

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • 7.0.0
    • parser

    Description

      ValueRange is a simple construct which works on any java.lang.Number. Examining a heap dump of Junos 19.3 test case reveals we are allocating java.math.BigIntegers to hold ranges – 32428 instances

      Each BigInteger costs us 64 bytes of memory, even when we could get away with much smaller storage – Integer/Uint32 and Long/Uint64 end up costing 16/24 bytes, hence we could potentially cut memory usage from ~2.5MiB to 500-800KiB.

      Track down the user and try to persuade it to use smaller Number classes.

      Attachments

        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: