I wrote a function that queries a database and limits the results to 100. Then it does some processing and checks to see if there are any more database entries to process. If there are more to process then it calls itself again. The problem that I am having it that it keeps using memory until it runs out and crashes. I have followed it in a debugger and with each iteration it overwrites existing variables and none of the grow in size. What should I start looking for to correct the memory usage problem? What are some suggested solutions?