Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Java heap space

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Thanked 0 Times in 0 Posts

    Lightbulb Java heap space

    hi all

    Actually i want to upload more than 500 mb file using struts file upload features.
    I have successfully upload the file less than 200 mb.
    I have increase the java heap size and tomcat heap size in catalina.bat file and in myeclipse also.
    i have also set java_opts and catalina_opts in environment variable.
    i have also set in controller class in struts-config.xml file as
    <controller maxFileSize="1G" nocache="true" bufferSize="1073741824"/>
    but still i am facing same problem like this.

    at java.io.FileInputStream.readBytes(Native Method)
    at java.io.FileInputStream.read(FileInputStream.java: 177)
    at org.apache.commons.fileupload.disk.DiskFileItem.ge t(DiskFileItem.java:308)
    at org.apache.struts.upload.CommonsMultipartRequestHa ndler$CommonsFormFile.getFileData(CommonsMultipart RequestHandler.java:600)
    at actions.FileUploadAction.execute(FileUploadAction. java:44)
    at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:849)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)

    pls suggest me how to upload file more than 500 mb.

  2. #2
    Join Date
    Jul 2013
    Thanked 18 Times in 17 Posts

    Default Re: Java heap space

    There is one config file somewhere in tomcat folder.
    Did you go and change the size there? You already said you did. But still I wanted to make sure if you did the right way.

    You have to modify two possible limits:

    In conf\server.xml

    <Connector port="80" protocol="HTTP/1.1"
    maxPostSize="67589953" />
    In webapps\manager\WEB-INF\web.xml

    <!-- 52MB max -->

    Source: java - HttpRequest maximum allowable size in tomcat? - Stack Overflow


Similar Threads

  1. Java Heap Space
    By aussiemcgr in forum Java Theory & Questions
    Replies: 4
    Last Post: September 8th, 2010, 05:05 PM
  2. Replies: 15
    Last Post: February 28th, 2010, 09:30 PM
  3. Java heap space error
    By Loki in forum What's Wrong With My Code?
    Replies: 3
    Last Post: January 27th, 2010, 09:47 PM
  4. Out of memory - Java heap space
    By fraxx in forum Java Theory & Questions
    Replies: 4
    Last Post: November 24th, 2009, 04:26 AM
  5. OutOfMemoryError (Java heap space)
    By chronoz13 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 21st, 2009, 10:56 AM

Tags for this Thread