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

Mike Sokolov commented on LUCENE-8642:
--------------------------------------

I feel like there is a value to a partial solution here, throwing an exception 
for unhandled types. I even think it has value when the estimates are not 
perfect (like for HashMap, where our accounting for internal Entry objects is 
pretty crude). It may not be perfect, but sometimes you really do want a tool 
for this, and there is nothing else quite like RamUsageEstimator :). I'm more 
thinking of cases where you want to optimize heap usage, rather than unit tests 
_per se_. Even for unit tests, it can be useful to be able to assert that RAM 
usage is under some bound to guard against future scaling mess-ups, and getting 
a precise measurement may not always be critical.

> RamUsageTester.sizeOf ignores arrays and collections if --illegal-access=deny
> -----------------------------------------------------------------------------
>
>                 Key: LUCENE-8642
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8642
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Dawid Weiss
>            Assignee: Dawid Weiss
>            Priority: Minor
>
> We have a silent fall-through on catch clause there if a field is 
> inaccessible. This causes all collections to not be recursively descended 
> into.
> We could hack it so that collection objects are counted "manually". Or we 
> could propagate illegal access exception from ram tester, detect which tests/ 
> objects do try to measure collection objects and either remove them (if it's 
> not possible to measure accurately) or change them (if it is possible to 
> estimate the size in a different way).
> Looking for feedback on this one.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to