I am Linux server with cPanel. My problem is that i keep getting PermGenSpace error; even though i have set the -Xms and -Xmx attributes in starttomcat under /usr/sbin. I have searched thru the net, but I am not been able to find any solution to my problem.

Any suggestions?

For PermGenSpace error try setting the parameters

-XX:PermSize and -XX:MaxPermSize

e.g.
-XX:PermSize=256m -XX:MaxPermSize=512m

hi,
thanks for the response. should i change these settings in starttomcat? i made these changes in catalina.sh.

thanks

Yeah thats right. The changes are to be made in catalina.sh

e.g.

JAVA_OPTS="-Xms128m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=1024m"

Better yet, find out where in your application you're doing too many String.intern() operations (implicitly or explicitly) and fix that.
That's the cause of over 90% of all permgen space errors.

Better yet, find out where in your application you're doing too many String.intern() operations (implicitly or explicitly) and fix that.
That's the cause of over 90% of all permgen space errors.

i have made all the necessary changes for setting up permgenspace. still the same problem..:(

i find lot of System.out.println statements in jsp and action files. could that be a culprit?

> i find lot of System.out.println statements in jsp and action files. could
> that be a culprit?

Possibly, given that the arguments are converted to String. How many is 'lot'?

BTW, are you getting the errors during application startup or after a specified duration of running the application. If the latter, you need to make sure you are using an appropriate garbage collection strategy though I must admit that any application which takes up more than 512 MB of permagen space is pretty much a badly coded piece of work.

Also, I get the feeling that the permagen settings are being ignored. Paste here/link us to the latest catalina.sh file just in case.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.