File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes RichFaces File Upload crashes Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "RichFaces File Upload crashes Tomcat" Watch "RichFaces File Upload crashes Tomcat" New topic

RichFaces File Upload crashes Tomcat

Kavita Tipnis
Ranch Hand

Joined: Sep 21, 2008
Posts: 177
Adding richfaces file upload feature to an existing web-app, suddenly causes the JVM running Tomcat to run out of memory sporadically.
I have a max upload file size (specified in my web.xml) to 1GB (Not sure if this causes the problem)
I have increased the underlying JVM options -Xms and -Xmx , I am going to increase the PermSize now from the default 64M.
However I am completely clueless as to why the JVM crashes, as not too many users access it at the same time.
Also the Tomcat Server Status shows free memory available upto 512 MB approx at a given time.

Perhaps it would help to give my configuration
Tomcat version 6.0.18
Richfaces 3.3.0
JSF 1.2

My current JAVA_OPTS: -Xms512M -Xmx1024M

I have not set the -XX:MaxPermSize yet, will try that.
Also researching more on this I found a flag to set the JVM to run in server mode. I am not clear on this. I woul appreciate if you guys can shed some light on this.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

I've been spending the last week doing almost nothing but RichFaces file uploads and haven't crashed Tomcat once, using Tomcat6.

RichFaces has its annoyances, but this part of the system seems to be pretty reliable. I think maybe you should inquire in the Tomcat forum and provide some crash data.

An IDE is no substitute for an Intelligent Developer.
Kavita Tipnis
Ranch Hand

Joined: Sep 21, 2008
Posts: 177
Thanks Tim,
RichFaces is definitely reliable, but I just added the file upload on one of the apps which made me think otherwise.
As far as the Tomcat issue goes, I removed the extra apps which were no longer needed and trying to do a stress/crash test on the RichFaces app.
It has survived so far so I might be right in concluding that the RichFaces file upload is not the issue, but maybe some memory leak.
I agree. Here's the link:
subject: RichFaces File Upload crashes Tomcat
jQuery in Action, 3rd edition