[
https://issues.apache.org/jira/browse/LUCENE-5197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13756924#comment-13756924
]
Dawid Weiss commented on LUCENE-5197:
-------------------------------------
> incorrect for some type of objects
Can you elaborate on this? Where was it incorrect?
> would not the logic in implementing the "excluded objects" change just as
> much?
I think it'd be much simpler to exclude the type of objects we know spin out of
control - loggers, thread locals, thread references and leave the remaining
stuff accounted. After all if it's referenced it does take space on the heap so
the figure is correct. What you're doing is actually a skewed view -- it
measures certain fields selectively.
I was also thinking in terms of tests -- one can create a sanity test which
will create a small index, measure its RAM usage and then fail if it seems "too
large" (because a thread local or some other field was accounted for). I don't
see a way to do such a sanity check for per-class handcrafted code (unless you
want to test against RamUsageEstimator, which would duplicate the effort
anyway).
Let me stress again that I'm not against your patch, I just have a gut feeling
it'll be a recurring theme of new issues in Jira.
Yet another idea sprang to my mind -- perhaps if speed is an issue and certain
types of objects can efficiently calculate their RAM usage (FSTs), we could
make RamUsageEstimator "aware" of such objects by introducing an interface like:
{code}
interface IKnowMySize {
public long /* super. :) */ sizeMe();
}
{code}
Jokes aside, this could be implemented for classes which indeed have a complex
structure and the rest (arrays, etc.) could be counted efficiently by walking
the reference graph. Just a thought.
> Add a method to SegmentReader to get the current index heap memory size
> -----------------------------------------------------------------------
>
> Key: LUCENE-5197
> URL: https://issues.apache.org/jira/browse/LUCENE-5197
> Project: Lucene - Core
> Issue Type: Improvement
> Components: core/codecs, core/index
> Reporter: Areek Zillur
> Attachments: LUCENE-5197.patch, LUCENE-5197.patch
>
>
> It would be useful to at least estimate the index heap size being used by
> Lucene. Ideally a method exposing this information at the SegmentReader level.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]