Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
MapReduce >> mail # dev >> Can we use String.intern inside WritableUtils#readString()?


Copy link to this message
-
Can we use String.intern inside WritableUtils#readString()?
Hi All,
  I noticed that WritableUtils.readString(), while deserializing the  
strings, creates a string object every time. But there may be  
applications, which serialize a small no of the strings, a huge number  
of times. So while deserializing them, this may lead to OOMs sometimes.

I think using intern() will reduce the creation of the number of  
String objects. Please correct me if my understading is wrong.

--
Thanks&Regards,
Bh.V.S.Kamesh,
+91-9652725948
+
Ramkumar Vadali 2012-07-12, 18:27
+
Robert Evans 2012-07-13, 14:57