Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Out of Memory Error  RSS feed

Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application with JSP as front end & Java to perform the business logic. I have a data file(flat file) which has around 600000 lines of data. when I was coding i used some 10000 lines of data from original data file. Everything was working well and i got the desired output. But when i tried using the Original data file (with 600000 lines) i got the following exception ..... can anyone help me in resolving this..i tried to increase the default & maximum heap size of the VM din't work...

Ctx( /myApps ): Exception in: R( /myApps + /model.jsp + nu
ll) - javax.servlet.ServletException
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.tomcat.core.ServletWrapper.doService(
at org.apache.tomcat.core.Handler.service(
at org.apache.tomcat.core.ServletWrapper.service(
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.
at org.apache.tomcat.core.ContextManager.service(
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
at org.apache.tomcat.service.TcpWorkerThread.runIt(
at org.apache.tomcat.util.ThreadPool$
Root cause:
<<no stack trace available>>
thanks in advance..
Author and all-around good cowpoke
Posts: 13078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems to me that 600,000 x chars per line * 2 bytes per UNICODE character amounts to a pretty large amount of memory if you are storing String objects. How about making a byte[] to hold the file - saves all that String creation.
If your 600,000 line file is bigger than memory then you will need to use random access anyway.
author of:
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!