You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by SMX25 <to...@rediffmail.com> on 2012/11/24 11:22:26 UTC

PermGen error on starting up the container

Hello,

I have an existing service mix container V3.4 running a legacy application
on production. As part of my project we need to deploy another service mix
container V5.4 on the same machine and install new service assembly on that.

In development, I am facing the following PermGen error randomly while
starting my newly developed container and I have not been able to figure out
what could be causing this. Though this is very infrequent(once in 15-20
start ups ) I can't afford to go into production with this error unless I
have a valid justification.

Error messages spitted out are

/| WARN  - DefaultManagementLifecycleStrategy - This
CamelContext(transitionComponentCamelContext) will be registered using the
name: transitionComponentCamelContext-2 due to clash with an existing name
already registered in MBeanServer.
jvm 1    | ERROR - LwContainerComponent           -
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'applicationContextBuilder' defined in file
[/opt/metro/fusion-to-source-transition/container/data/smx/service-assemblies/transition-sa/version_1/sus/servicemix-lwcontainer/transition-su/servicemix.xml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class
[com.specsavers.fusion.source.transition.configuration.ApplicationContextBuilder]:
Constructor threw exception; nested exception is java.lang.OutOfMemoryError:
PermGen space
jvm 1    | Exception in thread "Timer-3" java.lang.OutOfMemoryError: PermGen
space/


What I found out on google about this error is that this is caused when PERM
GEN memory is not enough and memory leaks cause PERM GEM space to fill up,
the application throws this error and hence a possible solution is to
increase the PERM GEN size. I also found out that the PERM GEN holds the
meta data for classes and not the real objects so its not a problem of
orphaned objects.

Since the other container on the production is  working without any explicit
PERM GEN setting, I would not want to go with the approach of increasing the
PERM GEN size unless I know the root cause of the problem.

So considering all above, my queries are 
- Why this error is not consistent in my application?
- What else could be causing this?

Please share your views and correct me if any of my understanding stated
above is incorrect.

Thanks & Regards,





--
View this message in context: http://servicemix.396122.n5.nabble.com/PermGen-error-on-starting-up-the-container-tp5714968.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: PermGen error on starting up the container

Posted by Brian Topping <to...@codehaus.org>.
On Nov 24, 2012, at 5:22 AM, SMX25 <to...@rediffmail.com> wrote:

> Since the other container on the production is  working without any explicit
> PERM GEN setting, I would not want to go with the approach of increasing the
> PERM GEN size unless I know the root cause of the problem.

You might simply be on the cusp of the right amount of memory.  The PermGen setting that comes with containers is an approximation, there's no way to get it right for every deployment -- too large wastes memory, too small is fatal, and every deployment has a wide variety of deployed classes.

The best way for you to find the answer for your environment is to use a profiler such as YourKit and look for yourself.  Start by looking at your current configuration to see how much PermGen space is available, then bump it up by 50% and see if it remains within 10-20% of the original number in all cases.  If so, leave it at that number and profile it in production with lots of users as well.  There's no sense not knowing what's happening there.

Brian