13 Replies Latest reply on Nov 18, 2002 8:18 AM by adrian.brock

    java.lang.OutOfMemoryError

    muradhak

      Hi,
      I am actually investigating the JBoss-JOnAs performances. Currently our application is using JOnAs. Since our application touches its peak with JOnAs, we thought of migrating to JBoss3.0x.

      I am using JBoss3.0 for the investigation puepose. The performance of JBoss is significantly higher than JOnAs.

      But when I tried to reproduce a stress test scenario in JBoss, it gave the abve error. This scenario works fine in JOnAs, but time consumed is more.

      I have seen threads in the forums abt this error, but no answers.

      Does JBoss memory mangement have this problem, or as a developer does anything else has to be added as a part of application code.

      Cheers
      Muraly

        • 1. Re: java.lang.OutOfMemoryError

          Have you changed the bean cache size?

          By default it is set at 1,000,000 PER BEAN in
          standardjboss.xml which is probably too large
          for your memory.

          The 2.x default was 1,000 but that is probably too small.

          Regards,
          Adrian

          • 2. Re: java.lang.OutOfMemoryError
            muradhak

            Hi,
            Thanks for the suggestion....
            The PC in which I am running the JBoss is having 1gb RAM. Just FYI.
            Then while searching the FORUM, I got the follwing inputs.
            One is to use JBoss3.0.4, currently I am using 3.0.0, which has some memory leaks fixed.
            Next is to use -Xincgc as a java option while starting JBoss.

            What is your opinion on this?
            How can I find the optimal size of cache for my apllication?
            Currently I am going to bring it by half, just blindly.

            Cheers
            Muraly

            • 3. Re: java.lang.OutOfMemoryError

              Opinions cost money :-)

              It really does depend upon your application/data.
              Without analysis, the next best thing is experiment.

              e.g. You have 2000 Customers of which maybe 20-100 get
              used a normal working data set.
              Is it the same customers all the time (your main
              customers) or does it depend on the orders being taken?

              The cache is per bean. You can add the settings to
              jboss.xml that fit each bean.

              Regards,
              Adrian

              • 4. Re: java.lang.OutOfMemoryError
                muradhak

                Hi,
                Message Understood, Sound and Clear..;)

                Thanks
                Muraly

                • 5. Re: java.lang.OutOfMemoryError
                  vickyk

                  Hi Adrian,
                  I dont have the docs for Jboss and find harder to work with Jboss but still prefer this due to its opensource.For Stateless session option in standardjboss.xml,Can you explain why there is no

                  <container-cache-conf> ...

                  but the folliwng is:

                  <container-pool-conf>
                  100
                  </container-pool-conf>

                  The lifecycle of the EJBs is clear ,I would appericiate if you could give explaination with the life cycle of the EJBs.
                  Regards
                  Vicky

                  • 6. Re: java.lang.OutOfMemoryError

                    Try to keep posts on topic.

                    There is no bean cache for stateless beans.
                    They are all equivalent and just need pooling.

                    If there are too many to back in the pool
                    after use, they are thrown away.

                    Regards,
                    Adrian

                    • 7. Re: java.lang.OutOfMemoryError
                      taiwubrian

                      Hi,

                      I had the memory problem since 3.0.0alpha. In addition to the memory leak problem, the cache size is the key, isn't it? If I use the default of 1,000,000, does this mean that any bean will be cached until the number of beans reach the limit?

                      Are the beans being cached by different clients shared?

                      I cache data on the client side. Then, the client can do anything offline before she ever needs to persist her data. In this case, is it recommended to set the bean cache size as small as possible?

                      Best Regards,

                      Brian

                      • 8. Re: java.lang.OutOfMemoryError

                        Like I said above, the cache is per bean.
                        The clients share the cache.
                        Set the maximum cache to whatver will fit in memory.
                        You will need to trade-off between beans, which beans
                        have what maximum cache size.

                        The other (probably better) alternative is to buy more
                        memory. The more caching the better performance you
                        will get.

                        Regards,
                        Adrian

                        • 9. Re: java.lang.OutOfMemoryError
                          vickyk

                          Hi Adrian,
                          > There is no bean cache for stateless beans.
                          > They are all equivalent and just need pooling.
                          I do understand this.
                          > If there are too many to back in the pool
                          > after use, they are thrown away.
                          What about the Container pool,I mean do the Jboss implementation creats the container pool for the each type of ejb? What I can understand is that there will be one container for each type of the EJB which will be instantiated at the start of the Jboss,and these Container Objects can be pooled.Please clasrify this?
                          regards
                          Vicky

                          • 10. Re: java.lang.OutOfMemoryError

                            I already told you once to stay on topic,
                            if you continue to fork I will stop answering your
                            questions. Start a new thread for new questions.

                            This thread is about bean cache and memory.

                            There is no such thing as a container pool,
                            bean object instances are pooled. The containers
                            are JMX mbeans.

                            Regards,
                            Adrian

                            • 11. Re: java.lang.OutOfMemoryError
                              taiwubrian

                              Hi, Adrian,
                              Please help.

                              In standardjboss.xml, the max-capacity element for the container IIOP CMP 2.x EntityBean is used as default cache size. Right?

                              Is the element list-cache-max in jbosscmp-jdbc.xml used to set the per bean cache?

                              Do you mean that I should set the max-capacity to fit the size of memory and trade off the cahch size among beans by adjusting list-cache-max for each bean?

                              Best Regards,

                              Brian

                              • 12. Re: java.lang.OutOfMemoryError

                                max-capacity is for the bean cache.
                                list-cache-max is for the read-ahead results.

                                Regards,
                                Adrian

                                • 13. Re: java.lang.OutOfMemoryError

                                  > There is no such thing as a container pool

                                  Apologies, the bean pool is called container-pool in
                                  jboss.xml

                                  Regards,
                                  Adrian