File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

java.lang.OutOfMemoryError: Java heap space

Steve kuan

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

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(
    at com.mysql.jdbc.MysqlIO.nextRow(
    at com.mysql.jdbc.MysqlIO.readSingleRowSet(
    at com.mysql.jdbc.MysqlIO.getResultSet(
    at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(
    at com.mysql.jdbc.MysqlIO.readAllResults(
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
    at com.mysql.jdbc.ConnectionImpl.execSQL(
    at com.mysql.jdbc.ConnectionImpl.execSQL(
    at com.mysql.jdbc.StatementImpl.executeQuery(
    at org.apache.jsp.searchValidation_jsp._jspService(
    at org.apache.jasper.runtime.HttpJspBase.service(
    at javax.servlet.http.HttpServlet.service(
    at org.apache.jasper.servlet.JspServletWrapper.service(
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(
    at org.apache.jasper.servlet.JspServlet.service(
    at javax.servlet.http.HttpServlet.service(
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    at org.apache.catalina.core.StandardWrapperValve.invoke(
    at org.apache.catalina.core.StandardContextValve.invoke(
    at org.apache.catalina.core.StandardHostValve.invoke(
    at org.apache.catalina.valves.ErrorReportValve.invoke(
    at org.apache.catalina.core.StandardEngineValve.invoke(
    at org.apache.catalina.connector.CoyoteAdapter.service(
    at org.apache.coyote.http11.Http11Processor.process(
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
    at Source)

  • Please advise. Thanks in advance.
    Bear Bibeault
    Author and ninkuma

    Joined: Jan 10, 2002
    Posts: 63868

    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] [About Bear] [Books by Bear]
    Paul Clapham

    Joined: Oct 14, 2005
    Posts: 19973

    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

    Joined: Aug 23, 2008
    Posts: 38

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

    I agree. Here's the link:
    subject: java.lang.OutOfMemoryError: Java heap space
    jQuery in Action, 3rd edition