InputStream java.lang.OutOfMemoryError: Java heap space

Hi, In my autoupdater I read and save files from the server one at a time using TCP.
After reading about 10 files the autoupdater runs out of memory. Is there a way I can “clear” the inputstream after each file so that I don’t run out of memory? None of the files are too large by themselves.

Thanks,
roland

InputStreams / OutputStreams do not keep the data that went through them in RAM. If it stays in RAM for some reason, it’s your own code doing it (which is nice, because then you can find and fix it).

Thanks. You were right. I was sending a file that was larger than the maximum packet size over TCP and that was stuffing it up. I guess I’ll split the file into 60kb packets :slight_smile: