posted 15 years ago
Well I would say, over here closing/not closing stream could not be cause of out of Memory. most of output stream source code does not do anything while you close stream. it is blank implemented in sub classes.
And look for your example, that depends on the scope where image is being created/loaded.
If it is per user (per request) a different instance, will reach max usage of memory 200*10 = 2000 MB (~2GB).
is this right?
either look for current memory allocated to your JVM?
further analysis you need a tool like JProve etc or try to check jheap and jstate map to see which and how many objects are lying in the memory with this operation.