lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] Commented: (LUCENE-2556) CharTermAttribute cloning memory consumption
Date Fri, 23 Jul 2010 05:55:50 GMT


Uwe Schindler commented on LUCENE-2556:

This patch optimizes the cloning of the CharTermAttributeImpl internal buffer. It keeps using
clone() to clone the internal buffer when CharTermAttribute.length() is at least 150 and at
least 75% and of the internal buffer length, otherwise, it uses System.arrayCopy(...) to clone
it using CharTermAttribute.length() as the new internal buffer size. 
It's performing the optimization, because in some scenarios, like cloning long arrays, clone()
is usually faster than System.arrayCopy(...). 

Haven't seen your patch yet. I dont know if the two extra calculations rectify the barnching,
because terms are mostly short...

If we take your patch, the allocations should in all cases be done with ArrayUtils.oversize()
to be consistent with the allocation strategy of the rest of CTA.

> CharTermAttribute cloning memory consumption
> --------------------------------------------
>                 Key: LUCENE-2556
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Analysis
>    Affects Versions: 3.0.2
>            Reporter: Adriano Crestani
>            Assignee: Uwe Schindler
>            Priority: Minor
>             Fix For: 3.1
>         Attachments:, LUCENE-2556.patch,
> The memory consumption problem with cloning a CharTermAttributeImpl object was raised
on thread

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message