I have mulitthreaded programs that read large xmls and currently convert them to String e.g:
String temp = MyObject.convertToString(xmls);
i have to pass on this String to various methods to process it. The Question is not related to appending BUT holding/Storing this large text in an Object i.e String OR StringBuilder.
How String and StringBuilder will affect performance/memory, my thinking is that if i keep using String it will pool the string in JVM with multiple XMLS. In other case it will be an Object and will be GC'd once not required or set to null. More over what will be the behavior of Stringbuilder.toString() on memory then.
StringBuilder's purpose to build or manipulate string. If you do not manipulate your string then usestring. If you worried about performence/memory of keeping and readingstring- definitely use astring