Servlet downloading very large file causing Outofmemory exception
843842Jun 16 2010 — edited Jun 18 2010Hi,
i am trying to download a file using http servlet output stream, by reading the records from the database and download the records as a file. I am writing the records to the stream using the method write(byte[]) and flushing it regularly. But i still get Outof memory exception. When i debugged the code found that count on the output stream keep on growing even after calling flush() method.
Is there any way i can download very large files. Is it just any setting in server configuration or does it require java code change. Please let me know its urgent for me.