lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adriano Crestani (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-2556) CharTermAttribute cloning memory consumption
Date Fri, 23 Jul 2010 05:37:50 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-2556?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Adriano Crestani updated LUCENE-2556:
-------------------------------------

    Attachment: lucene_2556_adriano_crestani_07_23_2010.patch

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(...). 

> CharTermAttribute cloning memory consumption
> --------------------------------------------
>
>                 Key: LUCENE-2556
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2556
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Analysis
>    Affects Versions: 3.0.2
>            Reporter: Adriano Crestani
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: CharTermAttributeMemoryConsumptionDemo.java, lucene_2556_adriano_crestani_07_23_2010.patch
>
>
> The memory consumption problem with cloning a CharTermAttributeImpl object was raised
on thread http://markmail.org/thread/bybuerugbk5w2u6z

-- 
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message