12 Replies Latest reply on Apr 27, 2011 3:14 PM by Rajasundaram Gopalan

    Core dump

    Rajasundaram Gopalan Novice

      We have used kill -SEGV command in unix to generate the core dump file. Can you please recommend any tools to convert the core dump file to heap dump file or any tools can be used to analyze the core dump file.



      Server: jboss 4.2.3 GA

      java version :

      linux: Red hat


      I have MemoryAnalyzer and VisualVM tools.

        • 1. Core dump
          Peter Johnson Master

          Why do you want to debug the internals of the JVM? What do you think that will buy you? If what ypu are really after is analyzing the heap, there are better ways to do that.

          • 2. Core dump
            Wolf-Dieter Fink Master

            What you want to analyze?

            For a memory leak you better use a profiler in a test environment.

            For GC problems you might use the GC logfiles or the jconsole.


            If you describe what you try to do and write your expectations it will be possible to help.

            • 3. Core dump
              Rajasundaram Gopalan Novice

              We have a class which was instatiated only one time and loads the xml data. Data was used throughout our application. Some or all the data lost in production server. This is happening randomly between 7 to 20 days. So, I want to check the object contents using the core dump file. If you want to see the code I will attach the code.

              • 4. Core dump
                Peter Johnson Master

                You do not want to use a core dump for that. Instead, take a heap dump and use a tool like VisualVM to anayze it. VisualVM can take the heap dump for you, or you can use jmap.

                1 of 1 people found this helpful
                • 5. Core dump
                  Rajasundaram Gopalan Novice

                  but I have only the core dump and I have requested system administrator to generate the heap dump when the problem occurs next time. I used the jmap to convert the core dump to heap dump but it failed.


                  coredump file size was 2 gb


                  Following command I used:

                  -bash-3.2$ jmap -dump:format=b,file=/tmp/heap_30704.hprof /usr/java/bin/java /home/rgopala/core.30704


                  Attaching to core /home/rgopala/core.30704 from executable /usr/java/bin/java, please wait...


                  Error attaching to core file: Can't attach to the core file

                  • 6. Core dump
                    Peter Johnson Master

                    Are you running jmap on the system where the core dump was taken? Is /usr/java/bin/java the exact JVM that was used?

                    I don't know if jmap needs OS information as well as the executable information.


                    Just saw this for VisualVM, perhaps it will help:


                    • 7. Core dump
                      Rajasundaram Gopalan Novice

                      No I have copied core dump file to the test environment which has the same setup.

                      • 8. Core dump
                        Rajasundaram Gopalan Novice

                        I am trying to use the jconsole but no luck.


                        jboss_console throws following error.


                        17:06:35,345 ERROR [STDERR] Caused by: java.lang.RuntimeException: javax.managem

                        ent.JMRuntimeException: Failed to load MBeanServerBuilder class org.jboss.mx.ser

                        ver.MBeanServerBuilderImpl: java.lang.ClassNotFoundException: org.jboss.mx.serve


                        17:06:35,345 ERROR [STDERR]     at sun.management.Agent.error(Agent.java:309)

                        17:06:35,345 ERROR [STDERR]     at sun.management.Agent.startAgent(Agent.java:15


                        17:06:35,345 ERROR [STDERR]     at sun.management.Agent.agentmain(Agent.java:95)


                        17:06:35,345 ERROR [STDERR]     ... 6 more

                        17:06:35,345 ERROR [STDERR] Caused by: javax.management.JMRuntimeException: Fail

                        ed to load MBeanServerBuilder class org.jboss.mx.server.MBeanServerBuilderImpl:

                        java.lang.ClassNotFoundException: org.jboss.mx.server.MBeanServerBuilderImpl

                        17:06:35,345 ERROR [STDERR]     at javax.management.MBeanServerFactory.checkMBea


                        17:06:35,345 ERROR [STDERR]     at javax.management.MBeanServerFactory.getNewMBe


                        17:06:35,345 ERROR [STDERR]     at javax.management.MBeanServerFactory.newMBeanS


                        17:06:35,345 ERROR [STDERR]     at javax.management.MBeanServerFactory.createMBe


                        17:06:35,360 ERROR [STDERR]     at javax.management.MBeanServerFactory.createMBe


                        17:06:35,360 ERROR [STDERR]     at sun.management.ManagementFactory.createPlatfo


                        17:06:35,360 ERROR [STDERR]     at java.lang.management.ManagementFactory.getPla


                        17:06:35,360 ERROR [STDERR]     at sun.management.jmxremote.ConnectorBootstrap.s


                        17:06:35,360 ERROR [STDERR]     at sun.management.Agent.startAgent(Agent.java:13


                        17:06:35,360 ERROR [STDERR]     ... 7 more

                        17:06:35,360 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: org.jbo


                        17:06:35,360 ERROR [STDERR]     at java.net.URLClassLoader$1.run(URLClassLoader.


                        17:06:35,360 ERROR [STDERR]     at java.security.AccessController.doPrivileged(N

                        ative Method)

                        17:06:35,360 ERROR [STDERR]     at java.net.URLClassLoader.findClass(URLClassLoa


                        17:06:35,360 ERROR [STDERR]     at java.lang.ClassLoader.loadClass(ClassLoader.j


                        17:06:35,360 ERROR [STDERR]     at sun.misc.Launcher$AppClassLoader.loadClass(La


                        17:06:35,360 ERROR [STDERR]     at java.lang.ClassLoader.loadClass(ClassLoader.j


                        17:06:35,360 ERROR [STDERR]     at javax.management.MBeanServerFactory.loadBuild


                        17:06:35,360 ERROR [STDERR]     at javax.management.MBeanServerFactory.checkMBea


                        17:06:35,360 ERROR [STDERR]     ... 15 more


                        I used following command to start my server


                        run.bat -b -Dcom.sun.management.jmxremote


                        Please refer:http://community.jboss.org/thread/52095

                        • 9. Re: Core dump
                          Peter Johnson Master

                          For remote access you need more config info than that. See: http://download.oracle.com/javase/1.5.0/docs/guide/management/agent.html#remote

                          If I recall correctly, security is on by default so you have to explicitly turn it off if you don't want it. Also, make sure that the port is open in the server's firewall.


                          Question: why are you running jconsole?

                          • 10. Core dump
                            Rajasundaram Gopalan Novice

                            why are you running jconsole? If I am correct then I should able to see the run time objects and its value.


                            I am trying to use my local machine where the server is running and I have configured following on my run.bat file.


                            rem set JAVA_OPTS=${JAVA_OPTS} -Dcom.sun.management.jmxremote

                            rem set JAVA_OPTS=${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=12345

                            rem set JAVA_OPTS=${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false

                            rem set JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"

                            rem set JAVA_OPTS="${JAVA_OPTS} -Djboss.platform.mbeanserver"

                            rem set JAVA_OPTS="${JAVA_OPTS} -Djavax.management.builder.initial=org.jboss.system\.server.jmx.MBeanServerBuilderImpl"


                            let me know if I need to make any changes.


                            When I try to access using jconsole request went through the server but it got errored out. I have posted the error message on my previous reply.


                            Do you recommend any tool for to get heap dump for the remote server?

                            • 11. Core dump
                              Peter Johnson Master

                              JConsole will not let you see what is in the heap (at least, I don't think it does, been a long time since I used it). Try VisualVM insteat, like I mentioned.


                              Regarding the run.bat, It would help if you uncommented the statements!

                              1 of 1 people found this helpful
                              • 12. Core dump
                                Rajasundaram Gopalan Novice

                                I used visual vm and connected the remote host by jmx remoting but still I am not able to see the objects in memory I think it is only available once we

                                got the heap dump. But I can see the cpu usage and heap.