my dog learned polymorphism*
The moose likes Struts and the fly likes error: 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 » Frameworks » Struts
Bookmark "error: "java.lang.OutOfMemoryError: Java heap space"with method="POST" enctype="multipart/form-data"" Watch "error: "java.lang.OutOfMemoryError: Java heap space"with method="POST" enctype="multipart/form-data"" New topic
Author

error: "java.lang.OutOfMemoryError: Java heap space"with method="POST" enctype="multipart/form-data"

david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 133
Hi,

To make the ActionForm include fields to upload the file, I change
to .

Then when I update the actionForm with more than 200 fields, I got the error "java.lang.OutOfMemoryError: Java heap space".

I use a map in the actionForm to store those fields values as: .

If I decrease the fields to less 200, it works fine. But When there is over 200 fields, it will has the memory error though the form does not include the upload file.

I am wondering why I could upload like 2M file with the form without problem, but it can not handle the case when the form has many fields. And solutions for it? In some cases, it will have more fields like 300 or 400 a form. And I do need upload feature as well.

Thanks for the help!!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

A form with several hundred fields?!
david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 133
Yeah, this form is created dynamically based on some template. For example, creating a question and answer form. If the template allows 10 max question and 20 max for answer, when form is created according to its max, each page will have 10 questions and 20 answers per question, which will be 210 field in this case. Though user may only input a few questions, but the form need to be that big.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error: "java.lang.OutOfMemoryError: Java heap space"with method="POST" enctype="multipart/form-data"
 
Similar Threads
Map the action form object
incompatible: File Upload + Validator Client side JS
[Help, File Upload encounter OutOfMemoryError]
enctype="multipart/form-data" request.getParameter() issue
File Upload