hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen O'Malley <omal...@apache.org>
Subject Re: clearing o.a.h.io.Text
Date Fri, 01 Jan 2010 07:03:32 GMT

On Dec 30, 2009, at 12:36 AM, Kay Kay wrote:

> In o.a.h.io.Text - the clear method currently just resets length to  
> 0, while not doing anything about the bytes internally.
>
> Curious to know the thoughts behind the decision (to let the  
> internal bytes to be reused for future appends  vs. memory leaks due  
> to not clearing them ) ?

The byte array that backs up the Text object is always reused. It  
might make sense to have a setCapacity method on Text that is similar  
to BytesWritable's. With such a method, it would be possible to shrink  
the size of the backing array.

-- Owen

Mime
View raw message