• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.OutOfMemoryError

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

we r getting the following error during the process.
we r using IIS and tomcat server and we have 1GM of ram.
// what i have done in my jsp
end =get doc cout* from the db
count=100
start=1
do{
if(count > end){
count=end;
}
select col1,col2 from tbl1 where serial_no between "start" and "count"
{
here we r using search engine API's to get the field information's
process
and insert the value to another table ( lets table2)
}
start=count;
count=count+100;
}while(start!=end)
// end process

and we r having 40k doc's in the table. And my program run up 30k doc's
And during the process im getting the error like...

Internal Servlet Error:
javax.servlet.ServletException
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:508)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
Root cause:
java.lang.OutOfMemoryError
<>

can anyone give me some solution to fix this out.........
thanks and regards
vishnu
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried tweaking the heap size flags (-Xms and -Xmx) when you start Tomcat?
Simon
 
vishnu mohan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no Simon, Let me know how to do that....
thanks...
 
author
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry if this is too simple a suggestion, but have you ensured that you're not getting into an infinate loop? This is, by far, the most cpmmon cause of an out of memory exception.
Sean
 
Author
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
to tweak the heap size use
java -Xms256M -Xmx256M runthewebserver
the line above will increase the heap size from the default (64M i think) to 256. It will also help boot up of the server. If you dont care about boot up, then set the -Xms one to a lower amount for more reponsible memory allocation.
I think it is probably a infinite loop problem though - tweaking the heap size will only make you wait longer. Why dont you print out end to the screen, or log it somewhere and check that its not some rediculous size.
also is it possible that the result set size is so big its crashing the system?
 
reply
    Bookmark Topic Watch Topic
  • New Topic