Link to home
Start Free TrialLog in
Avatar of jayatallen
jayatallen

asked on

how to take thread and heap dump on windows 2003 server

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
ASKER CERTIFIED SOLUTION
Avatar of Govvy
Govvy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jayatallen
jayatallen

ASKER

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.
You need to download from Microsoft WinInternals site...
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?
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 .
SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you for your reply.

can we use procdump for taking heap dump of a java process also?
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.
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?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
enabling debug privilege helped.thank you