0

When I send large form in struts2 the server throws a PermGen error and don’t saves all the form data.

the form has 6 fields and a grid, the grid has 10 columns where each row of the grid is a subpojo inside an ArrayList. The problem arises when I'm using the form and I have over 1000 rows in the grid. Upon receiving the pojo, the server starts saving the data but on the row 833, more or less, throws me a PermGen error.

The system specs are:

  • CPU: AMD Phenon X6 - 2.8 Ghz
  • Total Memory: 8Gb
  • JVM Memory: 2Gb
  • Tomcat Memory Pool: 2Gb
  • PermGen: 512Mb
  • JRE 6.37, Tomcat 7.0.37

What is the best way to solve this problem?

Roman C
  • 49,761
  • 33
  • 66
  • 176
Aegis
  • 113
  • 7
  • 27
  • 1
    Easiest way is to increase the PermGen for your server. Look here on how to do it http://stackoverflow.com/questions/3003855/increase-permgen-space – Leonard Brünings Mar 28 '13 at 18:05
  • Can you share memory distribution for JVM and system specs ? – Jabir Mar 28 '13 at 18:07
  • PermGen is much fun you have to play with the JVM. – Roman C Mar 28 '13 at 18:13
  • Not much use today but the next java version is supposed to get rid of the PermGen space...http://openjdk.java.net/jeps/122 – Quaternion Mar 28 '13 at 18:39
  • hi, i added my system specs – Aegis Mar 28 '13 at 18:50
  • 1
    Not a direct solution, but I would rethink the design that calls for, what is in effect, a 1000 row form. It must be a nightmare to use. – user497087 Mar 29 '13 at 07:27
  • @aegis the issue should be resolved with Leonard's link. If so please close this question. – Quaternion Mar 30 '13 at 05:47
  • @user497087 there are a few cases where web forms are used to add comma/tab delimited data, from a spread sheet for example. If the data was treated as a single string you should be able to iterate over the data, handling it rather than turn the whole thing into an expensive object model. This means avoiding automatic type conversion... it's not a typical case so a non typical solution is probably acceptable. That said I don't think you should format the data into cells or anything, just send it as one block. Then page it back after it's processed. – Quaternion Mar 30 '13 at 05:50

1 Answers1

0

Increasing the PermGen solves my problem.

bjb568
  • 11,089
  • 11
  • 50
  • 71
Aegis
  • 113
  • 7
  • 27