?
Solved

how to take thread and heap dump on windows 2003 server

Posted on 2011-10-27
13
Medium Priority
?
1,890 Views
Last Modified: 2012-05-12
Hi Folks,

I need to take thread  and heap  dump every 2 hours  for a tomcat process running on windows server 2003.
I was thinking to use scheduler to execute a script which will take the thread and heap dump and save it file.

Could you please help :
1)how to take thread and heap dump in windows ? tried crt break option..didnt work
2)how to incoprate this in a script as  crt break requires manual intervention?
3)if we use kill -QUIT PID ,will it work? how do we find PID of a java server iin windows server?
4)if we succeed to take the thread dump,how we would redirect in a file?

Please help.
Thank you,
Joe
0
Comment
Question by:jayatallen
  • 6
  • 3
  • 2
11 Comments
 
LVL 13

Accepted Solution

by:
Govvy earned 668 total points
ID: 37040591
0
 

Author Comment

by:jayatallen
ID: 37041741
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Documents and Settings\artos_ad>procdump
'procdump' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\artos_ad>

Seems like i dont have procdump installed.
0
 
LVL 13

Expert Comment

by:Govvy
ID: 37044347
You need to download from Microsoft WinInternals site...
0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 

Author Comment

by:jayatallen
ID: 37045008
is it possible to avoid installing this software? Because in my firm,they probably wont allow me install components which is not a approved built from them.
Is there any other way to implement my question?
0
 

Author Comment

by:jayatallen
ID: 37047728
i checked procdump..how can we find the PID using a script? I mean Task manager will show it but i want to run this using a script .
0
 
LVL 71

Assisted Solution

by:Qlemo
Qlemo earned 1332 total points
ID: 37053019
ProcDump does not require you to use the PID, you can also provide the process name. But if you want to provide that nevertheless, you can use something like (in a .cmd batch file):
for /F "tokens=2" %%P in ('tasklist /fi "imagename eq tomcat.exe"  /fo list ^| find "PID"') do set PID=%%P
procdump -s 7200 %PID% tomcat.dmp

Open in new window

That will use the last PID found. It will terminate if the PID does not exist any longer.
Of course, just using
procdump -s 7200 tomcat.exe tomcat.dmp

Open in new window

seems to be more straightforward ;-).
0
 

Author Comment

by:jayatallen
ID: 37053277
thank you for your reply.

can we use procdump for taking heap dump of a java process also?
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 37054143
That's something I have to pass to Java experts. I suppose a precompiled code language like Java needs a special interpreter for the stack info.
0
 

Author Comment

by:jayatallen
ID: 37059082
C:\Documents and Settings\Artemis_AD\Desktop>procdump.exe -s 9628 9628 tomcat.dm
p
Error opening tomcat5.exe (9628):
Access is denied.


Somehow i am getting access denied.Though the process is running with my userid on  a windows server 2003 and im logged in using remote desktop connection.

I get the same error ,if i try to jstack,jmap utility.

Could you help figuring out this issue?
0
 
LVL 71

Assisted Solution

by:Qlemo
Qlemo earned 1332 total points
ID: 37062792
You might not have the debug privilege needed. Are you Power User or Admin on that machine?
0
 

Author Comment

by:jayatallen
ID: 37111670
enabling debug privilege helped.thank you
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month16 days, 2 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question