hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kay Kay <kaykay.uni...@gmail.com>
Subject clearing o.a.h.io.Text
Date Wed, 30 Dec 2009 08:36:18 GMT
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 ) ?  Thanks.

$ svn diff
Index: src/java/org/apache/hadoop/io/Text.java
===================================================================
--- src/java/org/apache/hadoop/io/Text.java    (revision 894545)
+++ src/java/org/apache/hadoop/io/Text.java    (working copy)
@@ -224,6 +224,7 @@
    */
   public void clear() {
     length = 0;
+    bytes = EMPTY_BYTES;
   }


Mime
View raw message