GeeCON Prague 2014*
The moose likes JSP and the fly likes java.lang.OutOfMemoryError: Java heap space Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "java.lang.OutOfMemoryError: Java heap space" Watch "java.lang.OutOfMemoryError: Java heap space" New topic
Author

java.lang.OutOfMemoryError: Java heap space

Steve kuan
Greenhorn

Joined: Jul 25, 2012
Posts: 2
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

    Joined: Jan 10, 2002
    Posts: 61315
        
      66

    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?


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    Paul Clapham
    Bartender

    Joined: Oct 14, 2005
    Posts: 18570
        
        8

    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?
    jaan bhavsar
    Ranch Hand

    Joined: Aug 23, 2008
    Posts: 32
    Hi,

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

    Regards
    Jatan
     
    GeeCON Prague 2014
     
    subject: java.lang.OutOfMemoryError: Java heap space