3 Replies Latest reply on May 17, 2013 5:01 AM by bmajsak

    OutOfMemoryError in Arquillian with JBoss 7.1

    mk_2013

      Hello,

       

      I have some test classes that run with JUnit and Arquillian in standalone JBoss 7.1 as remote. Each class create deployment and contains some test cases.

       

      After running all tests I received OutOfMemoryError. I looked at heap dump in Exclipse Memory analizer and found that it contains org.jboss.arquillian.testenricher.cdi.container.CDIExtension objects for each of my test classes. It seems like test deployment was not undeploy from JBoss.

       

      I don't know how to find the cause of the problem and fix it. Coulld someone advise me? Thanks.

        • 1. Re: OutOfMemoryError in Arquillian with JBoss 7.1
          jhuska

          Hello,

           

          we used to get OutOfMemoryErrors related to the PermGen space. Is this your case ?

           

          The thing is that each deployment leaves something in PermGen, and then depending on how big deployments you have the container can run out of memory.

           

          There are two solutions:

          1. increase PermGen space for your container

          2. use managed container which can be set to be restarted after custom number of test classes

           

          Or your problem is sowhere else ?

          • 2. Re: OutOfMemoryError in Arquillian with JBoss 7.1
            mk_2013

            Hello,

             

            Yes, it's PermGen problem. I increased size of PermGen  but I'd prefer fix cause of problem. Does Arquillian clear memory after undeploying test or no? I want use remote container because it work faster.

             

            BR

            • 3. Re: OutOfMemoryError in Arquillian with JBoss 7.1
              bmajsak

              Arquillian undeploys all its' artifacts after the test execution, so in fact it's cleaning up. However memore management is up to server/jvm, Arquillian is not really in the position to do anything around that. Therefore it's not any different than deploying/undeploying normal application.