1 Reply Latest reply on Mar 28, 2012 6:01 AM by guinotphil

    Continuous Integration vs. Permgen Errors

    rkilcoyne

      Has anyone had any success in working around permgen errors when running JBoss under a continuous integration server like Bamboo or Hudson. We're using Bamboo and our builds deploy nicely for approximately 10 iterations. At that point the server needs to be restarted or a permgen out of memory error occurrs. I've tried working around this by bouncing JBoss with every deploy, but I run into the issue that the init.d script hangs the build server because of the way it forks the service process and holds the ssh connection.

       

      Thanks,

      Rick

        • 1. Re: Continuous Integration vs. Permgen Errors
          guinotphil

          Hi,

           

          You might be interrested in reading this: https://community.jboss.org/thread/195134

           

          You may have some class loader memory leak with your application. I suggest you to use Eclipse Memory Analyser to check why the memory is not garbage collected. However, there might still be a few bugs in various component causing the leaks, but hopefully they'll be fixed soon. Most of them must be causes by uses of ThreadLocal of WeakHashMap anyway (see http://wiki.apache.org/tomcat/MemoryLeakProtection)

           

          On the other hand, as stated in my post, the Permgen can not be garbage collected to easily, so even if you have some SoftReferences, they won't be destroyed until the Heap Space is full, so you can't really cause the PermGen to get freed.

           

          > but I run into the issue that the init.d script hangs the build server because of the way it forks the service process and holds the ssh connection

           

          To restart the AS 7 server via SSH you might want to run ssh -ttt $USER@$HOST "sudo /etc/init.d/jboss-as restart". The ttt paramter avoid tty to wait forever when the init.d script start the server.