Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.OutOfMemoryError: Java heap space

 
Steve kuan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I am using eclipse EE to write my JSP script which will get the data from MySQL database but I being thrown error
messages.

Here's my code:


And Error Message's here:

  • Jul 27, 2012 9:44:12 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.OutOfMemoryError: Java heap space
    at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2123)
    at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1900)
    at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3401)
    at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:483)
    at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3096)
    at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2266)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2687)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2713)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2663)
    at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1599)
    at org.apache.jsp.searchValidation_jsp._jspService(searchValidation_jsp.java:102)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)


  • Please advise. Thanks in advance.
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Pie
    Posts: 64683
    86
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    First read, this JspFaq entry.

    Then find out why your app is using too much memory (profiling tool) or allocate more memory to the Java process.

    How many rows are getting fetched?
     
    Paul Clapham
    Sheriff
    Pie
    Posts: 20945
    31
    Eclipse IDE Firefox Browser MySQL Database
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Reading all of the records of a very large query, and then checking to see whether the last record read happens to match the input data, is an extremely poor strategy. Besides the obvious problems which you have already observed, what happens if the record you are looking for is not the last one returned?
     
    Jordan Josh
    Ranch Hand
    Posts: 41
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi,

    Can you tell us what you are trying to achieve from this code ,so we can better help you.

    Regards
    Jatan
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic