How could this code is executed as part of a thread run out of memory? Here is the info that I have. It runs as part of a thread. So I can see if too many threads are open at once. That is not the case. Also, before I added those close statements, we would see a message on Linux that said it ran out of file descriptors. I have not been able to get in touch with the sys admin for the box to see if that is still the case.
Anyone see anything in this code, that could be causing a problem?
Can you determine which line is throwing the error? Usually you will get a stack trace, however with an OutOfMemoryError it's possible you won't. However you could insert some more print statements between the existing lines of code, and then by looking at the output just before the OOME you can determine where you were in the code.