The file itself is not that big, should fit in memory. But once you combine that with other overhead factors then starts to become a problem. We are building a DOM in memory and that is not scaling for us. Using raw output streams seems problematic in the sense that we have to be careful about escaping characters. The file itself is not that big, should fit in