• Post Reply Bookmark Topic Watch Topic
  • New Topic

Out of Memory Error  RSS feed

brisk rook
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 ..it din't work...

Ctx( /myApps ): Exception in: R( /myApps + /model.jsp + nu
ll) - javax.servlet.ServletException
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:4
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java
at java.lang.Thread.run(Thread.java:484)
Root cause:
<<no stack trace available>>
thanks in advance..
William Brogden
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:
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!