5 Replies Latest reply on May 7, 2004 2:05 PM by heikok

    OutOfMemory after some 1000 CMP Beans

    heikok

      I've written some CMP EJB with Jboss 3.2.3 and JConnector 3.1/MySQL. The CMP Beans are connected to remote via a stateless Management Bean.

      I use the 'default' setup for jboss, which means about 100 Beans should keep in memory. Though, after creating some thousand beans (depending on the java -Xmx settings) jboss throws a Out of memory. It seems like the Beans never get destroyed.

      There is a self-referential CMP bean (A) and a bean (B) containing refrence to (A), so in database-world, each A has many A's, each A has many B, each B has exactly one A.

      Any hints about how to find out more about the memory-leak is welcome.

      Best regards,

      Heiko

        • 1. Re: OutOfMemory after some 1000 CMP Beans
          heikok

          I ran now the same code with SUNs J2EE reference and Pointbase. Memory usage was constant after the first 1000 Beans (initialization). I've been running the test up to 5000 Beans. So it seems to be a jboss-related problem.

          Heiko

          • 2. Re: OutOfMemory after some 1000 CMP Beans

            100 is the pool size, the default cache size is 1 million in jboss.
            see standardjboss.xml

            Also if you are using hsqldb, its tables are fully loaded into memory unless
            you use "create cached table".

            • 3. Re: OutOfMemory after some 1000 CMP Beans
              triathlon98

              Adrian,

              The setting is not enough. I have run into the same problem (and reported it) a couple of weeks back. I then tried modifying the container configuration and the read-ahead setting to anything I could image without results.

              However, I have seen that Alexey committed some changes in the cache handling. It may be better/fixed in the latest version in CVS (I was using the latest version at the time, but have not updated meanwhile).

              Joachim

              • 4. Re: OutOfMemory after some 1000 CMP Beans

                Alexey is working on instance-per-transaction which isn't a real cache.

                You ain't going to get much help with more info.
                Asserting you've done things correctly isn't very useful.

                • 5. Re: OutOfMemory after some 1000 CMP Beans
                  heikok

                  Configuring the cache-size down to 1000 worked wonder. I just uploaded 20000CMPs with -Xmx=32m setting without problems.

                  Thanks for the help,

                  Heiko