7 Replies Latest reply: Feb 12, 2013 3:32 PM by user593469 RSS

    How to take a heap dump

    Sahasra
      Hi all,

      our production weblogic servers are getting crashed. there are stuck threads and server is getting crashed with out of memory. I took the thread dump but i am not familiar with heap dump.

      So, are there any commands to take a heap dump or any tools to take a heap dump. If you have any documentation on analysing the heap dump, it would be much helpful. Which is the best tool for analysing heap dump.
        • 1. Re: How to take a heap dump
          815319
          Hi.

          Check JVM Options as follow.

          -XX:+HeapDumpOnOutOfMemoryError
          -XX:+HeapDumpOnly

          Based on HP Unix.

          Edited by: Kyoungmin Lee on 2011. 3. 30 오후 7:02
          • 2. Re: How to take a heap dump
            Akshay Koul
            Refer:-

            http://wiki.eclipse.org/index.php/MemoryAnalyzer#Getting_a_Heap_Dump

            http://www.bonitasoft.org/blog/eclipse/acquire-heap-dump-from-mat/

            http://download.oracle.com/javase/1.5.0/docs/tooldocs/share/jmap.html

            http://download.oracle.com/javase/6/docs/technotes/tools/share/jmap.html

            &

            http://dev.eclipse.org/blogs/memoryanalyzer/

            http://dev.eclipse.org/blogs/memoryanalyzer/2008/05/27/automated-heap-dump-analysis-finding-memory-leaks-with-one-click/

            http://dev.eclipse.org/blogs/memoryanalyzer/2008/04/21/immortal-objects-or-how-to-find-memory-leaks/

            -Akshay
            • 3. Re: How to take a heap dump
              Ravish Mody_MiddlewareMagic
              Hi Sahasra,

              I would suggest you to have a look at the below links which would surely help and also would give you a better idea how to avoid such situations.

              Topic: WebLogic Heap Dump Genration Using Jmap
              http://middlewaremagic.com/weblogic/?p=2241

              Topic:  Heap Dump Using Jhat for WebLogic Server Heap Analysis
              http://middlewaremagic.com/weblogic/?p=2202

              For percussion

              Topic:OutOfMemory Causes and First Aid Steps?
              http://middlewaremagic.com/weblogic/?p=4464

              Topic: Causes and First Aid of JVM Crash Issues?
              http://middlewaremagic.com/weblogic/?p=4482

              Regards,

              Ravish Mody
              http://middlewaremagic.com/weblogic
              Come, Join Us and Experience The Magic…
              • 4. Re: How to take a heap dump
                Sahasra
                Thanks a lot. Will go through them.
                • 5. Re: How to take a heap dump
                  supratim
                  You can connect to the admin server with wlst and fire dumpStack() to get the dump. You can also redirect to a file for later reference.
                  • 6. Re: How to take a heap dump
                    user593469
                    This options works only when we restart the server and again when the server goes out of memory we can get the heapdump as per the arguments which you mentioned.

                    But how to collect a heapdump of a server which ran out of memory and which did not have those arguments of "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="
                    • 7. Re: How to take a heap dump
                      user593469
                      Hi Could you elaborate more on this. I tried it but it seems it dumps stack traces and not heap dump.


                      :)

                      Edited by: 987680 on Feb 12, 2013 1:32 PM