This happens if Terragen has trouble allocating a large enough chunk of RAM for the next section of the image it is rendering. How much RAM do you have?
We've made lots of changes to the renderer over the last few months, and some of them will help to reduce the likelihood of seeing this error, but we can't guarantee to entirely eliminate memory allocation problems.
It's often helpful to close and re-open TG2 before starting any renders that may take a few hours.
Matt