Well it could be that I've misunderstood this but..... it seems to me that the core of the problem is this process endlessly writing to a file. If that's the case possibly try using
ulimit and then forking the process. This should set the file-size writing limit imposed on files written and its child processes (files of any size may be read). Only a process with appropriate privileges can increase the limit.
Like I said I could be way off here.... but that would not be the first time ;-)