How to solve "Out of memory" exception problem while accessing huge data?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rahul_Kumar
Posted On:   Tuesday, July 25, 2006 05:56 AM


I have written code using JSP and java for displaying


certain reports. I am accessing data from DB through java beans and then displaying them in the report through JSP.



There is no problem while displaying the report for small data, but it throws a OUT of memory exception when a huge data arrives. What is the procedure to overcome this problem..Please let me know?

Re: How to solve "Out of memory" exception problem while accessing huge data?

Posted By:   Robert_Lybarger  
Posted On:   Tuesday, July 25, 2006 09:52 PM

The simplest answer probably involves boosting the heap space allocated to the JVM itself before you start your web container (tomcat? you didn't say). Refer to the java options "-Xms256m" and "-Xmx512m". Please change the numbers as appropriate to the memory you have available in your system. Also, usually you can just run "java -X" to get a help display about the various "X" options. These can also usually be set in a "JAVA_OPTS" environment variable. Try google for more info. Of course, if this doesn't solve your problem (you already maxed out the -Xmx option and it still happens) then you'll need to look into why the operation is taking so much memory and/or redesign the operation to work in chunks instead of all-at-once. (?)
About | Sitemap | Contact