Skip to main content

java.lang.OutOfMemoryError exception

2 replies [Last post]
Joined: 2008-05-03

HI all.

I am reading data from excel and storing it in database..
my excel file contains 50,000 rows..the soon i started uploading it is throwing out of memoryexception..
it will upload 2000 rows without any using tomcat 5 and oracle10g..pls tell me what will be the that anything related to coding part or server side (DB) i need to change anything config in tomcat..?am using jxl jar files for reading data from excel like workbook and sheet.

I have a doubt if my code contains any problem then it should throw error when i upload of file size 1MB..but it does not.....i dont understand how to fix this....i have surfed google abt this and tried to increase the heap size..but no solution.pls tell me one suggestion
thanx in advance

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2009-01-16

In general when processing huge files you should stream it so it's less likely to run out of memory.

I never used the JXL.jar so I don't know how JX processes the file. I suspect that it reads everything into memory. If so maybe it has the possibility to work with streams.

hope it helps.



Joined: 2009-04-20

The solution for most of the Java related errors can be found at this site: