On Saturday, January 5, 2013 12:35:27 PM UTC+1, Christian Sperandio wrote: > > About the String's expensiveness, working a lot with this kind of objects, > it's big enough. In fact, that depends if you have a lot of small strings > then the used memory space can become important. > For instance, the word "Bazinga" takes almost 60 bytes in memory (for a > 32bits JVM) in which 24 bytes are used by internal String object. That > space is bigger in 64 bits JVM. You can have more information from Internet > (like > http://blog.nirav.name/2011/11/optimizing-string-memory-footprint-in.html > ). > > Thus, when I need a lot of string chunks I often prefer use a characters > array. It reduces the used memory footprint. >
It is good to know that, as of Java 7 Update 6, the String overhead has been reduced by two ints (should be 8 bytes): there is no more sharing of the *char[]* and, consequently, no more *offset* and *count* variables. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en