6 Replies Latest reply on Sep 9, 2011 8:17 AM by wdfink

    Tool to monitor JBOSS performance and object causing memory leak issue

    jiteshagrawal

      Hi,

       

      I am having JBOSS 5.1 on Unix server. application (j2ee, ejbs)  is running fine, but many times suddenly application occupied all the memory and i need to restart the server. so i wanted a tool which can monitor application and tell me which objects has occupied memory and not releasing it.

       

      so please suggest some good tool for the same.

       

      Thanks

       

      Jitesh

        • 1. Re: Tool to monitor JBOSS performance and object causing memory leak issue
          rhusar

          Hi Jitesh, you need to track down the memory leak asap. Try getting a full heap first, you can use jmap

          jmap -dump:<dump-options> to dump java heap in hprof binary format

          after running for a while and then when memory rises, you take the heap snapshot again.

           

          Then download it over to your workstation and compare the heaps for isntance with JProfiler -- now you can easily see what objects are growing.

           

          http://www.ej-technologies.com/products/jprofiler/overview.html?gclid=CKrI6-ali6sCFYQRNAodCQJixw

          HTH

          Rado

          • 2. Re: Tool to monitor JBOSS performance and object causing memory leak issue
            wdfink

            I run jstat with option <each second> redirected into a file, this will give a good picture of the memory consumption over the time.

            Also it will have no big sideeffect to memory and resoures.

             

            JProfile is not a good idea in production, the server will become very slow ~10-20% of normal performance and maybe the problem dissapear because of less load.

            Memory snapshot might take a while during the dump and this might not acceptable in production.

            Could you also post the JVM start parameter?

             

            There are many reasons for such memory problems, so feel free to ask with more informations

            • 3. Re: Tool to monitor JBOSS performance and object causing memory leak issue
              rhusar

              I was talking about JProfiler for heap analysis not for online profiling. Otherwise okay ;-)

              • 4. Re: Tool to monitor JBOSS performance and object causing memory leak issue
                wdfink

                I know that you talk about 'ofline' using of jProfiler

                But some people try to use in a production environment and wonder about the dramatical performance loss or the dalsification of the behaviour.

                • 5. Re: Tool to monitor JBOSS performance and object causing memory leak issue
                  jiteshagrawal

                  Hi Wolf-Dieter Fink and Radoslav Husar ,

                  Thank you for the response,

                  will jstat provides object is causing the problem along with statistics for the heap/garbage colletion.
                  I wanted to know which object is causing the problem.
                  I have one ERP application (j2ee/ejbs) deployed on 5 jboss servers  (its not clustered) connect to one database server .
                  so each jboss server is handling a differnt set of users.
                  occassionaly on any server it occupy all the memory and i have to restart that server. it happen sometime on one server and sometime on another server.
                  its not a database issue, otherwise all 5 jboss app server should not work as database server is one.

                  i believe there is some module/classes in the application when it accessed then its eating up all the memory.
                  whats the tool/way by which i can identify those classes/object on production server..
                  this application having thousands of classes, therefore attaching a particular object to tool and see its life cycle is not fesible option for me.
                  so please suggest some way/tool by which i can get all the objects which casuing problems in production.
                  please let me know if you want more information.
                  Thank you very much.

                   

                  • 6. Re: Tool to monitor JBOSS performance and object causing memory leak issue
                    wdfink

                    With jstat you will only see the memory in total.

                    If you gan figure out that the bottom line of memory is growing up and never come done this is an indication for a application memory leak.

                     

                    You might try what Radoslav mentioned and dump the heap two times, e.g. after a while when JBoss was started and before crashing.

                    A comparsion between such dumps with jProfiler will show the what number of Objects are increasing.

                    But be aware that you must use more memory to analyze it.

                     

                    Other option is to do it with jProfiler in a test environment, start the UseCase take a snapshot, start it again (fire a GC with jProfiler) and compare it with the snapshot.

                    It might be easier and do not harm the production environment.