Huge form == huge memory usage, application dying

I have big memory problems:

I have an application that runs fairly well at the moment when allocated 1.5GB RAM but that I need to make it ALOT more memory efficient. The actual data I need to work with doesn't take up much space, but I have to work with some huge forms and all of the processing JSF is doing when I submit it causes all the memory (I'm testing with 768MB) to be eaten up and the application hangs, unable to finish the page request/rendering.

If I do average tasks with the application alot of short-lived objects are created whenever I submit a form / request a new page, but most of it is soon collected. (another issue is that alot of JSP classes get tenured and never used and they take up a fair amount of space until a full collection occurs). However, when I try to get it to do the most strenous possible task - the submission of a form with about 1219 input components - it doesn't have enough memory, the garbage collection doesn't free up enough space and it dies (just stops processing).

The stupid thing is that 600 of the input components are hidden and I really don't need (or want) them to be submitted, but I can't think of a way to stop them submiting. I think if I could find a way to either get rid of them (but still have their data somewhere for my Javascript methods) or stop them submitting it would free up alot of memory. Does anyone have any ideas about what I can do to cut down on my memory usage? Do converters use up a huge amount of memory? Any advice or ideas would be appreciated!

[1563 byte] By [Rave8151a] at [2007-11-27 2:38:36]
# 1
My only suggestion is to break up your massive form into several different pages.Certainly, with that many components, they can't all be related to each other. There must be a way for you to break apart the form into more than one page.CowKing
IamCowKinga at 2007-7-12 2:59:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Yes, that would make sense, but unfortunately my boss doesn't compromise. Everything has to be on one page, and everything has to be submitted with one button. And all of the components ARE related, but usually the page only has 20 - 100 components, but there are a few exceptions (the information in the data table is generated from results of database queries).

I thought of creating a second data table to hold the hidden components that don't need to be submitted and somehow hiding it. Does this sound like a possible solution? Or do you have any other ideas?

Rave8151a at 2007-7-12 2:59:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

> but unfortunately my boss doesn't compromise

Look for another employer ;)

Explain your boss that this is really a no-go in perspective to performance. Instead of multiple pages, you can consider a halfway-solution, like datatable paging, tabbing or dynamic subviews, all in the same page.

BalusCa at 2007-7-12 2:59:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
The rendered attribute might help you a little. At least if the rendered attribute is false on the component, JSF won't waste time trying to build it for the current view. Even then, JSF still will need to check each components rendered tag...CowKing
IamCowKinga at 2007-7-12 2:59:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...