lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Sokolov (JIRA)" <>
Subject [jira] [Commented] (LUCENE-8642) RamUsageTester.sizeOf ignores arrays and collections if --illegal-access=deny
Date Thu, 17 Jan 2019 03:01:00 GMT


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:
>             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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message