Re: How to solve "Out of memory" exception problem while accessing huge data?
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. (?)