Skip to main content

java.lang.OutOfMemoryError exception

2 replies [Last post]
mndprasad
Offline
Joined: 2008-05-03
Points: 0

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 problem..am using tomcat 5 and oracle10g..pls tell me what will be the problem...is that anything related to coding part or server side (DB)problem.do 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
mnd

Reply viewing options

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

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.

Cheers,

Salomo

gluk
Offline
Joined: 2009-04-20
Points: 0

The solution for most of the Java related errors can be found at this site: http://iderror.com/category/errors/java/