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

ASF GitHub Bot commented on PHOENIX-4998:
-----------------------------------------

Github user BinShi-SecularBird commented on the issue:

    https://github.com/apache/phoenix/pull/398
  
    @karanmehta93, I thought about it, but I eventually gave up for the reasons 
listed below:
    1. If we wrote this unit test, the unit test would look like in two ways
        a. In unit test, check GuidePostsInfo.GetEstimatedSize() is equal to a 
constant value or a value calculated in the ways mentioned in 
https://dzone.com/articles/estimating-java-object-sizes or 
https://github.com/twitter/commons/blob/master/src/java/com/twitter/common/objectsize/ObjectSizeCalculator.java.
 The former is useless if the developer forgot to change "int estimatedSize = 
..." in GuidePostsInfo's constructor, and the latter can only get an 
approximation of the object size.
        b. In unit test, list and check all the fields in GuidePostInfo are 
equal to what we have now. It seems overkilled and weird.
    2. We need to refactor GuidePostsInfo in the near future. I want to 
postpone how to calculate its object size and the unit test to that time.
    
    Please let me know if you have better idea.



> The estimated instance size of GuidePostsInfo doesn't count the last update 
> timestamp array
> -------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-4998
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4998
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Bin Shi
>            Assignee: Bin Shi
>            Priority: Major
>         Attachments: PHOENIX-4998.patch
>
>
> GuidePostsCache (implemented Guava Cache) use the estimated instance size of 
> GuidePostsInfo as the weight of the cache entry. The bug results in the 
> underestimation of the weight of the cache entry.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to