-
1. Core dump
peterj Apr 26, 2011 11:49 AM (in response to rajasundaram)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
wdfink Apr 26, 2011 1:30 PM (in response to rajasundaram)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 Apr 26, 2011 2:50 PM (in response to wdfink)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
peterj Apr 26, 2011 3:00 PM (in response to rajasundaram)1 of 1 people found this helpfulYou 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.
-
5. Core dump
rajasundaram Apr 26, 2011 3:04 PM (in response to peterj)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
peterj Apr 26, 2011 3:13 PM (in response to rajasundaram)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:
http://download.oracle.com/javase/6/docs/technotes/guides/visualvm/coredumps.html
-
7. Core dump
rajasundaram Apr 26, 2011 3:24 PM (in response to peterj)No I have copied core dump file to the test environment which has the same setup.
-
8. Core dump
rajasundaram Apr 26, 2011 5:10 PM (in response to rajasundaram)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
r.MBeanServerBuilderImpl
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
3)
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
nServerBuilder(MBeanServerFactory.java:480)
17:06:35,345 ERROR [STDERR] at javax.management.MBeanServerFactory.getNewMBe
anServerBuilder(MBeanServerFactory.java:511)
17:06:35,345 ERROR [STDERR] at javax.management.MBeanServerFactory.newMBeanS
erver(MBeanServerFactory.java:298)
17:06:35,345 ERROR [STDERR] at javax.management.MBeanServerFactory.createMBe
anServer(MBeanServerFactory.java:213)
17:06:35,360 ERROR [STDERR] at javax.management.MBeanServerFactory.createMBe
anServer(MBeanServerFactory.java:174)
17:06:35,360 ERROR [STDERR] at sun.management.ManagementFactory.createPlatfo
rmMBeanServer(ManagementFactory.java:302)
17:06:35,360 ERROR [STDERR] at java.lang.management.ManagementFactory.getPla
tformMBeanServer(ManagementFactory.java:504)
17:06:35,360 ERROR [STDERR] at sun.management.jmxremote.ConnectorBootstrap.s
tartLocalConnectorServer(ConnectorBootstrap.java:458)
17:06:35,360 ERROR [STDERR] at sun.management.Agent.startAgent(Agent.java:13
5)
17:06:35,360 ERROR [STDERR] ... 7 more
17:06:35,360 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: org.jbo
ss.mx.server.MBeanServerBuilderImpl
17:06:35,360 ERROR [STDERR] at java.net.URLClassLoader$1.run(URLClassLoader.
java:200)
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
der.java:188)
17:06:35,360 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.j
ava:307)
17:06:35,360 ERROR [STDERR] at sun.misc.Launcher$AppClassLoader.loadClass(La
uncher.java:301)
17:06:35,360 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.j
ava:252)
17:06:35,360 ERROR [STDERR] at javax.management.MBeanServerFactory.loadBuild
erClass(MBeanServerFactory.java:423)
17:06:35,360 ERROR [STDERR] at javax.management.MBeanServerFactory.checkMBea
nServerBuilder(MBeanServerFactory.java:465)
17:06:35,360 ERROR [STDERR] ... 15 more
I used following command to start my server
run.bat -b 0.0.0.0 -Dcom.sun.management.jmxremote
Please refer:http://community.jboss.org/thread/52095
-
9. Re: Core dump
peterj Apr 26, 2011 5:21 PM (in response to rajasundaram)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 Apr 27, 2011 9:13 AM (in response to peterj)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
peterj Apr 27, 2011 1:30 PM (in response to rajasundaram)1 of 1 people found this helpfulJConsole 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!
-
12. Core dump
rajasundaram Apr 27, 2011 3:14 PM (in response to peterj)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.