Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-10877

GridAffinityAssignment.initPrimaryBackupMaps memory pressure

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.8
    • None
    • None

    Description

      1) While running tests with JFR we observe huge memory allocation pressure produced by:

      Stack Trace TLABs Total TLAB Size(bytes) Pressure(%)

      java.util.HashMap.newNode(int, Object, Object, HashMap$Node) 481 298 044 784 100
      java.util.HashMap.putVal(int, Object, Object, boolean, boolean) 481 298 044 784 100
      java.util.HashMap.put(Object, Object) 481 298 044 784 100
      java.util.HashSet.add(Object) 480 297 221 040 99,724
      org.apache.ignite.internal.processors.affinity.GridAffinityAssignment.initPrimaryBackupMaps() 1 823 744 0,276

      org.apache.ignite.internal.processors.affinity.GridAffinityAssignment.<init>(AffinityTopologyVersion, List, List) 1 823 744 0,276

      Allocation stats

      Class Average Object Size(bytes) Total Object Size(bytes) TLABs Average TLAB Size(bytes) Total TLAB Size(bytes) Pressure(%)
      java.util.HashMap$Node 32 15 392 481 619 635,726 298 044 784 32,876
      java.lang.Object[] 1 470,115 461 616 314 655 019,236 205 676 040 22,687
      java.util.HashMap$Node[] 41 268,617 6 149 024 149 690 046,067 102 816 864 11,341
      java.lang.Integer 16 1 456 91 662 911,385 60 324 936 6,654
      java.util.ArrayList 24 1 608 67 703 389,97 47 127 128 5,198

      2) Also another hot place found

      Stack Trace TLABs Total TLAB Size(bytes) Pressure(%)
      java.util.ArrayList.grow(int) 7 5 766 448 9,554
      java.util.ArrayList.ensureExplicitCapacity(int) 7 5 766 448 9,554
      java.util.ArrayList.ensureCapacityInternal(int) 7 5 766 448 9,554
      java.util.ArrayList.add(Object) 7 5 766 448 9,554
      org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionTopologyImpl.nodes(int, AffinityTopologyVersion, GridDhtPartitionState, GridDhtPartitionState[]) 7 5 766 448 9,554

      The reason of that is defail

      I think we need to improve memory efficiency by switching from from Sets to BitSets

       

      JFR attached, see Allocations in 12:50:28 - 12:50:29

       

       

       

       

      Attachments

        1. grid.srv.node.1.0-29.12.2018-12.50.15.jfr
          1.96 MB
          Pavel Voronkin
        2. image-2019-01-17-12-58-07-382.png
          118 kB
          Pavel Voronkin
        3. image-2019-01-17-12-59-52-137.png
          91 kB
          Pavel Voronkin
        4. image-2019-01-17-15-45-49-561.png
          93 kB
          Pavel Voronkin
        5. image-2019-01-17-15-45-53-043.png
          93 kB
          Pavel Voronkin
        6. image-2019-01-17-15-46-32-872.png
          36 kB
          Pavel Voronkin
        7. image-2019-01-18-11-36-57-451.png
          20 kB
          Pavel Voronkin
        8. image-2019-01-18-11-38-39-410.png
          22 kB
          Pavel Voronkin
        9. image-2019-01-18-11-55-39-496.png
          20 kB
          Pavel Voronkin
        10. image-2019-01-18-11-56-10-339.png
          22 kB
          Pavel Voronkin
        11. image-2019-01-18-11-56-18-040.png
          20 kB
          Pavel Voronkin
        12. image-2019-01-18-12-09-04-835.png
          21 kB
          Pavel Voronkin
        13. image-2019-01-18-12-09-32-876.png
          18 kB
          Pavel Voronkin

        Issue Links

          Activity

            People

              voropava Pavel Voronkin
              voropava Pavel Voronkin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 50m
                  2h 50m