Use StringBuilder inside JSONNode.Escape instead of just concatenating strings. This seems to have a huge effect on memory allocations when the resulting string is several thousand characters long.