[ 
https://issues.apache.org/jira/browse/GEODE-7814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17046946#comment-17046946
 ] 

ASF subversion and git services commented on GEODE-7814:
--------------------------------------------------------

Commit 5a325f4fe59b6203ef93801ee185d2fb79a8f4c8 in geode's branch 
refs/heads/release/1.12.0 from Juan José Ramos
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=5a325f4 ]

GEODE-7814: Avoid Messaging Unnecessary Allocations (#4731)

Avoid unnecessary object allocations by making the attributes static.

(cherry picked from commit db86faec699aca67c02325bca22dcd5b913ddfed)


> Unnecessary Object Allocations in DistributionMessage
> -----------------------------------------------------
>
>                 Key: GEODE-7814
>                 URL: https://issues.apache.org/jira/browse/GEODE-7814
>             Project: Geode
>          Issue Type: Bug
>          Components: membership
>            Reporter: Juan Ramos
>            Assignee: Juan Ramos
>            Priority: Major
>              Labels: GeodeCommons
>             Fix For: 1.12.0, 1.13.0
>
>         Attachments: countDifference.png, timeSpent.png
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> 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).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to