Using the windows process explorer I can see that memory in my program goes up, then gets collected and drops back down in a constant loop until I uncomment the following function:

Code:
protected function marker( output:FileStream, file:File, i:int, j:int ):void
{
	output.open( file, FileMode.APPEND );
	output.writeUTFBytes( i + "\t" + j + "\n" );	
	output.close();				
}
With this function being called, the memory increases unboundedly until it reaches around 2GB and the whole thing crashes with an out of memory error. I was hoping someone could shed some light on where the leak here is and how to fix it, since I would like to be able to call this function reasonably frequently. Thanks. I think it's creating a new String each time but don't know why it's not being collected if this is in fact what's happening.