XmlElement, limit to text size



Is there a limit to the size of a text contents in an XmlElement? I have encoded an image in B64 and attempt to store it in XML, but creating the document sort of hangs. I'm having difficulties debugging but the memeory usage seem to grow to infinity, and beyond.



No, there's no limit, it just takes the String that you give it and stores that - in fact it doesn't do any allocation at all. So if you did have an infinite loop that hangs while generating the string, presumably that'd happen before you even get as far as passing the string to the XmlElement.


I use XmlElement::addTextElement and it seem to work great. The loop occurs in XmlElement::createDocument


If it matters, the base64 string is composed by MemoryBlock so there should (?) not be any huge incompatibilities.


Well, I don't know - you'd need to profile it to see what's happening, it's impossible for me to guess. But I do use that method to write some really big XML files in things like tracktion, and it all scales pretty well if you're not doing 100s of megabytes of data (and if you are, then XML is entirely the wrong thing to use!)