Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-7814

Unnecessary Object Allocations in DistributionMessage

    XMLWordPrintableJSON

Details

    Description

      The DistributionMessage class unnecessary allocates instances of java.util.Collection$SingletonList and InternalDistributedMember[] through the attributes EMPTY_RECIPIENTS_ARRAY and ALL_RECIPIENTS_LIST.
      These attributes are final and only used to execute internal comparisons but, since they are not declared as static, every instance of DistributionMessage will have its own instance, generating unnecessary garbage.
      Using one of our internal testing scenarios and a java profiler we detected that, under the current develop branch, we create 14.824 and 11.212  more instances of java.util.Collection$SingletonList and InternalDistributedMember[] than when using Geode 1.10.
      The increase in the memory footprint is not much (around 1MB all together), and the time spent on this operation is around 1.5 seconds slower overall (screenshots attached).

      Attachments

        1. countDifference.png
          53 kB
          Juan Ramos
        2. timeSpent.png
          111 kB
          Juan Ramos

        Issue Links

          Activity

            People

              echobravo Ernest Burghardt
              jjramos Juan Ramos
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 20m
                  20m