You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by wi...@infolan.es on 2006/02/21 18:12:00 UTC

RequestProcessor processPopulate heavily increases memory usage

Hi,

Last week we migrated our Struts 1.0 application to 1.2.8. As far as we 
can tell, we correctly followed the migration steps inbetween.
Since the migration we have noticed the following weird behaviour:
upon submitting a form from a jsp to as struts form/action, the method 
processPopulate of RequestProcessor will increase memory usage on our 
windows box by some 30M for each call. Unfortunately, this extra memory is 
not freed, not even after waiting more than say one hour. After a few such 
requests, needless to say, this produces OutOfMemoryErrors.
I pinpointed the memory usage to this method by setting 
log4j.logger.org.apache.struts=DEBUG in my log4j.properties. In the log, 
after form submission, the following info appears:

DEBUG: RequestUtils.createActionForm.300 ->  --> 
attend.forms.IncidentForm@ed3512 (21 feb 2006 17:59:31,156) 
DEBUG: RequestProcessor.processActionForm.327 ->  Storing ActionForm bean 
instance in scope 'request' under attribute key 'incidentForm' (21 feb 
2006 17:59:31,156) 
DEBUG: RequestProcessor.processPopulate.793 ->  Populating bean properties 
from this request (21 feb 2006 17:59:35,616) 
DEBUG: CommonsMultipartRequestHandler.getRepositoryPath.388 -> File upload 
temp dir: 
C:\dev\workspace-reconstruct-hibernate\Attend\work\org\apache\jsp (21 feb 
2006 17:59:35,772) 

What could be the cause of this excessive memory increase?

Could it be that the entire Struts config is accidentally reloaded because 
of a problem in our configuration?

Thanks,
Willem

Re: RequestProcessor processPopulate heavily increases memory usage

Posted by wi...@infolan.es.
Hi,
Thanks for your pointers.
It turns out that on *all* forms the enctype="multipart/form-data" was set 
even though no file upload was taking place. This caused the commons 
multipart request handler to allocate huge amounts of memory (256K for 
each field on the form) for each form which never get released. I 'fixed' 
it by setting memFileSize to a low value (2K) 
Apparently the enctype was added to all forms to circumvent problems when 
chaining Struts actions.
Yes I know, I just started here one month ago and ugly skeletons keep 
falling out of the closet every day.
Thanks for your time,
Willem





"Michael Jouravlev" <jm...@gmail.com>
21/02/2006 20:08
Por favor, responda a "Struts Users Mailing List"
 
        Para:   "Struts Users Mailing List" <us...@struts.apache.org>
        cc: 
        Asunto: Re: RequestProcessor processPopulate heavily increases 
memory usage


Session-scoped form can affect memory footprint on the first load and
barely on update. He gets +30M on each load. I doubt that reasonably
designed session-scoped form can be at fault here. It would sit there,
but it would not grow that fast. There should be something else that
he allocates.

BTW, his log shows request-scoped form.

Willem, try to create an empty action/form pair and test it. I suppose
this is something that you create.

Michael.

On 2/21/06, Joe Germuska <Jo...@germuska.com> wrote:
> Do you have a session scoped form with one or more FormFile
> properties?  Consider switching the scope to request, or
> alternatively, using the <controller> element to reduce the size of
> the in-memory file representation before the data is written to disk
> (see the memFileSize attribute described at
> 
http://struts.apache.org/struts-action/userGuide/configuration.html#controller_config

> )
>
> Joe
>
> At 6:12 PM +0100 2/21/06, willem.vermeer@infolan.es wrote:
> >Hi,
> >
> >Last week we migrated our Struts 1.0 application to 1.2.8. As far as we
> >can tell, we correctly followed the migration steps inbetween.
> >Since the migration we have noticed the following weird behaviour:
> >upon submitting a form from a jsp to as struts form/action, the method
> >processPopulate of RequestProcessor will increase memory usage on our
> >windows box by some 30M for each call. Unfortunately, this extra memory 
is
> >not freed, not even after waiting more than say one hour. After a few 
such
> >requests, needless to say, this produces OutOfMemoryErrors.
> >I pinpointed the memory usage to this method by setting
> >log4j.logger.org.apache.struts=DEBUG in my log4j.properties. In the 
log,
> >after form submission, the following info appears:
> >
> >DEBUG: RequestUtils.createActionForm.300 ->  -->
> >attend.forms.IncidentForm@ed3512 (21 feb 2006 17:59:31,156)
> >DEBUG: RequestProcessor.processActionForm.327 ->  Storing ActionForm 
bean
> >instance in scope 'request' under attribute key 'incidentForm' (21 feb
> >2006 17:59:31,156)
> >DEBUG: RequestProcessor.processPopulate.793 ->  Populating bean 
properties
> >from this request (21 feb 2006 17:59:35,616)
> >DEBUG: CommonsMultipartRequestHandler.getRepositoryPath.388 -> File 
upload
> >temp dir:
> >C:\dev\workspace-reconstruct-hibernate\Attend\work\org\apache\jsp (21 
feb
> >2006 17:59:35,772)
> >
> >What could be the cause of this excessive memory increase?
> >
> >Could it be that the entire Struts config is accidentally reloaded 
because
> >of a problem in our configuration?
> >
> >Thanks,
> >Willem

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



Re: RequestProcessor processPopulate heavily increases memory usage

Posted by Michael Jouravlev <jm...@gmail.com>.
Session-scoped form can affect memory footprint on the first load and
barely on update. He gets +30M on each load. I doubt that reasonably
designed session-scoped form can be at fault here. It would sit there,
but it would not grow that fast. There should be something else that
he allocates.

BTW, his log shows request-scoped form.

Willem, try to create an empty action/form pair and test it. I suppose
this is something that you create.

Michael.

On 2/21/06, Joe Germuska <Jo...@germuska.com> wrote:
> Do you have a session scoped form with one or more FormFile
> properties?  Consider switching the scope to request, or
> alternatively, using the <controller> element to reduce the size of
> the in-memory file representation before the data is written to disk
> (see the memFileSize attribute described at
> http://struts.apache.org/struts-action/userGuide/configuration.html#controller_config
> )
>
> Joe
>
> At 6:12 PM +0100 2/21/06, willem.vermeer@infolan.es wrote:
> >Hi,
> >
> >Last week we migrated our Struts 1.0 application to 1.2.8. As far as we
> >can tell, we correctly followed the migration steps inbetween.
> >Since the migration we have noticed the following weird behaviour:
> >upon submitting a form from a jsp to as struts form/action, the method
> >processPopulate of RequestProcessor will increase memory usage on our
> >windows box by some 30M for each call. Unfortunately, this extra memory is
> >not freed, not even after waiting more than say one hour. After a few such
> >requests, needless to say, this produces OutOfMemoryErrors.
> >I pinpointed the memory usage to this method by setting
> >log4j.logger.org.apache.struts=DEBUG in my log4j.properties. In the log,
> >after form submission, the following info appears:
> >
> >DEBUG: RequestUtils.createActionForm.300 ->  -->
> >attend.forms.IncidentForm@ed3512 (21 feb 2006 17:59:31,156)
> >DEBUG: RequestProcessor.processActionForm.327 ->  Storing ActionForm bean
> >instance in scope 'request' under attribute key 'incidentForm' (21 feb
> >2006 17:59:31,156)
> >DEBUG: RequestProcessor.processPopulate.793 ->  Populating bean properties
> >from this request (21 feb 2006 17:59:35,616)
> >DEBUG: CommonsMultipartRequestHandler.getRepositoryPath.388 -> File upload
> >temp dir:
> >C:\dev\workspace-reconstruct-hibernate\Attend\work\org\apache\jsp (21 feb
> >2006 17:59:35,772)
> >
> >What could be the cause of this excessive memory increase?
> >
> >Could it be that the entire Struts config is accidentally reloaded because
> >of a problem in our configuration?
> >
> >Thanks,
> >Willem

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: RequestProcessor processPopulate heavily increases memory usage

Posted by Joe Germuska <Jo...@Germuska.com>.
Do you have a session scoped form with one or more FormFile 
properties?  Consider switching the scope to request, or 
alternatively, using the <controller> element to reduce the size of 
the in-memory file representation before the data is written to disk 
(see the memFileSize attribute described at 
http://struts.apache.org/struts-action/userGuide/configuration.html#controller_config 
)

Joe



At 6:12 PM +0100 2/21/06, willem.vermeer@infolan.es wrote:
>Hi,
>
>Last week we migrated our Struts 1.0 application to 1.2.8. As far as we
>can tell, we correctly followed the migration steps inbetween.
>Since the migration we have noticed the following weird behaviour:
>upon submitting a form from a jsp to as struts form/action, the method
>processPopulate of RequestProcessor will increase memory usage on our
>windows box by some 30M for each call. Unfortunately, this extra memory is
>not freed, not even after waiting more than say one hour. After a few such
>requests, needless to say, this produces OutOfMemoryErrors.
>I pinpointed the memory usage to this method by setting
>log4j.logger.org.apache.struts=DEBUG in my log4j.properties. In the log,
>after form submission, the following info appears:
>
>DEBUG: RequestUtils.createActionForm.300 ->  -->
>attend.forms.IncidentForm@ed3512 (21 feb 2006 17:59:31,156)
>DEBUG: RequestProcessor.processActionForm.327 ->  Storing ActionForm bean
>instance in scope 'request' under attribute key 'incidentForm' (21 feb
>2006 17:59:31,156)
>DEBUG: RequestProcessor.processPopulate.793 ->  Populating bean properties
>from this request (21 feb 2006 17:59:35,616)
>DEBUG: CommonsMultipartRequestHandler.getRepositoryPath.388 -> File upload
>temp dir:
>C:\dev\workspace-reconstruct-hibernate\Attend\work\org\apache\jsp (21 feb
>2006 17:59:35,772)
>
>What could be the cause of this excessive memory increase?
>
>Could it be that the entire Struts config is accidentally reloaded because
>of a problem in our configuration?
>
>Thanks,
>Willem


-- 
Joe Germuska
Joe@Germuska.com * http://blog.germuska.com    

"You really can't burn anything out by trying something new, and
even if you can burn it out, it can be fixed.  Try something new."
	-- Robert Moog

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org