10 Replies Latest reply on Jul 15, 2011 2:37 PM by shamik

    Out of memory : Permgen Issue

    shamik

      Hi,

       

        I'm running into a java out of memory perm gen issue with my application. I've a SOAP endpoint which gets steady stream of request through out. I'm using the embedded jetty server with the connector Acceptors = 24 to restrict the concurrent request processing. The jetty threadpool is defined with 10 min and 100 max threads.

       

      Fuse gets started with 12GB memory  --> -Xmx12288m. After running for couple days, the service gets chocked up and throws "java.lang.OutOfMemoryError: PermGen space" exception. During this period and subsequent time, the memory usage is 100% with high CPU usage as well. I'm yet to do a detailed profiling to see where the bottleneck is.

       

      But as a best practice, are there any standard tuning options available at configuration level ? I've noticed that a chunk of resource is being is being utilized by ActiveMQ and Quartz. Are they being used by fuse/servicemix internally , if not can I safely turn them off since I'm not using them in my app ?

       

      Any pointer will be appreciated.

       

      - Thanks

        • 1. Re: Out of memory : Permgen Issue
          ffang

          Hi,

           

          Just a quick notes, for the "PermGen space" exception, you should use -XX:MaxPermSize=the_size_you_wantm

           

          Freeman

          • 2. Re: Out of memory : Permgen Issue
            shamik

            Freeman, I'm already using the permgen option with 500 mb allocated. Maybe, I need to bump up the number a little more.

             

            Meanwhile, can you let me know if ActiveMQ and Quartz services are required ?

            • 3. Re: Out of memory : Permgen Issue
              ffang

              Hi,

               

              I assume you're using FUSE ESB 4.x.

              ActiveMQ feature is used internally by jbi-cluster and servicemix-wsn2005.

              Anyway, if you don't use those at all, you can edit $FUSE_ESB/etc/org.apache.karaf.features.cfg and remove activemq-broker, jbi-cluster, servicemix-wsn2005 from featuresBoot.

              You can also remove servicemix-quartz from it.

              You actually can pick up the necessary default installed feature yourself by editing that file.

               

              Freeman

              • 4. Re: Out of memory : Permgen Issue
                shamik

                I removed activemq-broker, jbi-cluster, servicemix-wsn2005 and servicemix-quartz from the org.apache.karaf.features.cfg featuresBoot, but still able to see ActiveMQ Transport, Connection threads as well DefaultQuartzScheduler threads. Is there any other place I need to make the modifications? I'm using fuse 4.4

                • 5. Re: Out of memory : Permgen Issue
                  ffang

                  Hi,

                   

                  Also remove camel-activemq and servicemix-jms, as both dependency on activemq feature.

                   

                  Freeman

                  • 6. Re: Out of memory : Permgen Issue
                    shamik

                    Unfortunately, ActiveMQ and Quartz still shows up. This how the entry looks like :

                     

                    featuresBoot=karaf-framework,config,camel,camel-nmr,camel-cxf,war,servicemix-cxf-bc,servicemix-file,servicemix-ftp,servicemix-http,servicemix-mail,servicemix-smpp,servicemix-snmp,servicemix-vfs,servicemix-bean,servicemix-camel,servicemix-cxf-se,servicemix-drools,servicemix-eip,servicemix-osworkflow,servicemix-scripting,servicemix-validation,servicemix-saxon

                     

                    Probably,some other feature has an internal reference ?

                    • 7. Re: Out of memory : Permgen Issue
                      davsclaus

                      Most of the servicemix-xxx is JBI components. If you dont need that, then I suggest to try remove those features as well.

                       

                      For example I could imaging the osworkflow may depend and use Quartz as its a workflow engine

                      • 8. Re: Out of memory : Permgen Issue
                        shamik

                        Thanks Freeman, I'll try selectively remove them and see how it goes.

                        • 9. Re: Out of memory : Permgen Issue
                          ffang

                          Hi,

                           

                          That's Claus who answer you just now, I guess you wanna thank him.

                           

                          Freeman

                          • 10. Re: Out of memory : Permgen Issue
                            shamik

                            My bad, thanks Claus