This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 60785

    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

    Joined: Oct 14, 2005
    Posts: 18541

    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

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

    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    subject: java.lang.OutOfMemoryError: Java heap space
    Similar Threads
    authentication page
    The driver has not received any packets from the server
    jsp with servelet execution in tomcat
    Help with this code!