Re: thread dumps catalina.out
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 keeplearning, On 9/2/2009 3:09 PM, keeplearning wrote: Sorry. But I didn't understand how using 2 terminals would help me with the questions I posted. Then you need to do a 'man tee' and consider what Jim's trick is actually doing. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkqgMrsACgkQ9CaO5/Lv0PCH+gCfdHyCxd+59q7CZmDhazHGZb98 BBMAnj1hiNPM7AhGcrSD4IxbXqMDAHGw =Qc5p -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
thread dumps catalina.out
Hi All, I have a quick question about getting thread dumps. I have been told that if I do kill -3 process id, it will send the thread dumps to catalina.out. Let say if I run test 1 and take 3 dumps. Then if I run test 2 and 3 more. Do these get appended to first thread dumps I took? If yes, Let say if I run 3 different tests and take 3 dumps each test, how should I seperate those dumps as per specific tests. How do you guys normally do it? -- View this message in context: http://www.nabble.com/thread-dumps-catalina.out-tp25263566p25263566.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: thread dumps catalina.out
FWIW, I usually do a tail/tee on catalina.out in a term, then do the kill -QUIT tomcat PID from another term, then kill the tail/tee combo which leaves me with a reasonably clean thread dump. For example: Terminal A: prompt$ tail -f /usr/local/tomcat/logs/catalina.out | tee /tmp/tomcat-threads.tmpA Terminal B: prompt$ kill -QUIT 12345 On Wed, Sep 2, 2009 at 2:56 PM, keeplearningp_sodh...@yahoo.com wrote: Hi All, I have a quick question about getting thread dumps. I have been told that if I do kill -3 process id, it will send the thread dumps to catalina.out. Let say if I run test 1 and take 3 dumps. Then if I run test 2 and 3 more. Do these get appended to first thread dumps I took? If yes, Let say if I run 3 different tests and take 3 dumps each test, how should I seperate those dumps as per specific tests. How do you guys normally do it? -- View this message in context: http://www.nabble.com/thread-dumps-catalina.out-tp25263566p25263566.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: thread dumps catalina.out
From: keeplearning [mailto:p_sodh...@yahoo.com] Subject: thread dumps catalina.out I have been told that if I do kill -3 process id, it will send the thread dumps to catalina.out. I prefer to use jstack, since I can control where the output goes for each dump. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: thread dumps catalina.out
Sorry. But I didn't understand how using 2 terminals would help me with the questions I posted. Jim Cox-2 wrote: FWIW, I usually do a tail/tee on catalina.out in a term, then do the kill -QUIT tomcat PID from another term, then kill the tail/tee combo which leaves me with a reasonably clean thread dump. For example: Terminal A: prompt$ tail -f /usr/local/tomcat/logs/catalina.out | tee /tmp/tomcat-threads.tmpA Terminal B: prompt$ kill -QUIT 12345 On Wed, Sep 2, 2009 at 2:56 PM, keeplearningp_sodh...@yahoo.com wrote: Hi All, I have a quick question about getting thread dumps. I have been told that if I do kill -3 process id, it will send the thread dumps to catalina.out. Let say if I run test 1 and take 3 dumps. Then if I run test 2 and 3 more. Do these get appended to first thread dumps I took? If yes, Let say if I run 3 different tests and take 3 dumps each test, how should I seperate those dumps as per specific tests. How do you guys normally do it? -- View this message in context: http://www.nabble.com/thread-dumps-catalina.out-tp25263566p25263566.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- View this message in context: http://www.nabble.com/thread-dumps-catalina.out-tp25263566p25263811.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: thread dumps catalina.out
On 02.09.2009 21:05, Jim Cox wrote: FWIW, I usually do a tail/tee on catalina.out in a term, then do the kill -QUIT tomcat PID from another term, then kill the tail/tee combo which leaves me with a reasonably clean thread dump. For example: Terminal A: prompt$ tail -f /usr/local/tomcat/logs/catalina.out | tee /tmp/tomcat-threads.tmpA Terminal B: prompt$ kill -QUIT 12345 Depending on the JVM the dumps usually start with a header like Full thread dump... Recent Java 6 JVMs also add a timestamp to this header. Regards, Rainer On Wed, Sep 2, 2009 at 2:56 PM, keeplearningp_sodh...@yahoo.com wrote: Hi All, I have a quick question about getting thread dumps. I have been told that if I do kill -3 process id, it will send the thread dumps to catalina.out. Let say if I run test 1 and take 3 dumps. Then if I run test 2 and 3 more. Do these get appended to first thread dumps I took? If yes, Let say if I run 3 different tests and take 3 dumps each test, how should I seperate those dumps as per specific tests. How do you guys normally do it? -- View this message in context: http://www.nabble.com/thread-dumps-catalina.out-tp25263566p25263566.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: thread dumps catalina.out
Nothing magical to the two terms, just makes it easier to have a tail/tee combo running while issuing the kill -QUIT cmd (v. via job control, e.g). For example, in terminal A: prompt#tail -f /usr/local/tomcat/logs/catalina.out | tee /tmp/tomcat.dump.A Now in terminal B: prompt#ps -aef | egrep '[t]omcat' root 17660 1 0 Sep 01 ?6:15 /usr/java/bin/java -Dtomcat=1 -Xmx512m -Djava.awt.headl root 8918 8899 0 23:41:01 pts/30:00 tee /tmp/tomcat.dump.A root 8917 8899 0 23:41:01 pts/30:00 tail -f /usr/local/tomcat/logs/catalina.out prompt#kill -QUIT 17660 prompt# After stopping the tail/tee combo in Term A (with Ctrl+C): prompt#ls -alF /tmp/tomcat.dump.A -rw-rw-r-- 1 adir adir 20096 Sep 2 23:43 /tmp/tomcat.dump.A prompt#head /tmp/tomcat.dump.A Full thread dump Java HotSpot(TM) Client VM (1.4.2_13-b06 mixed mode): Thread-52 daemon prio=5 tid=0x007dc168 nid=0x40 waiting on condition [0xd0181000..0xd01819c8] at java.lang.Thread.sleep(Native Method) at org.apache.log4j.helpers.FileWatchdog.run(FileWatchdog.java:95) http80-Monitor prio=5 tid=0x00355f18 nid=0x39 in Object.wait() [0xd3081000..0xd30819c8] at java.lang.Object.wait(Native Method) - waiting on 0xd9057088 (a org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable) at org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable.run(ThreadPool.java:564) prompt#tail /tmp/tomcat.dump.A at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) VM Thread prio=5 tid=0x000d1120 nid=0x4 runnable VM Periodic Task Thread prio=10 tid=0x000d8110 nid=0xa waiting on condition Suspend Checker Thread prio=10 tid=0x000d5140 nid=0x7 runnable prompt# On Wed, Sep 2, 2009 at 3:09 PM, keeplearningp_sodh...@yahoo.com wrote: Sorry. But I didn't understand how using 2 terminals would help me with the questions I posted. Jim Cox-2 wrote: FWIW, I usually do a tail/tee on catalina.out in a term, then do the kill -QUIT tomcat PID from another term, then kill the tail/tee combo which leaves me with a reasonably clean thread dump. For example: Terminal A: prompt$ tail -f /usr/local/tomcat/logs/catalina.out | tee /tmp/tomcat-threads.tmpA Terminal B: prompt$ kill -QUIT 12345 On Wed, Sep 2, 2009 at 2:56 PM, keeplearningp_sodh...@yahoo.com wrote: Hi All, I have a quick question about getting thread dumps. I have been told that if I do kill -3 process id, it will send the thread dumps to catalina.out. Let say if I run test 1 and take 3 dumps. Then if I run test 2 and 3 more. Do these get appended to first thread dumps I took? If yes, Let say if I run 3 different tests and take 3 dumps each test, how should I seperate those dumps as per specific tests. How do you guys normally do it? -- View this message in context: http://www.nabble.com/thread-dumps-catalina.out-tp25263566p25263566.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- View this message in context: http://www.nabble.com/thread-dumps-catalina.out-tp25263566p25263811.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org