Extract base64 encoded field from JSON message and write the decoded field to a file

See this thread for how to diagnose the memory leak.

I would guess the problem is the json codec on the input -- it is just reading more and more data and never finding the end of the first JSON object.