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

Improve model.api.ValueRange$Range usage

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Medium Medium
    • 7.0.0
    • None
    • parser

      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.

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

              Created:
              Updated:
              Resolved: