Tracing which java process belongs to which WAS profile
Environment: Windows
While using Websphere Application Server to host each of the CLM applications on a different profile (on the same machine) - If a particular application is running out of memory, how do we find out which java process belongs to which WAS profile.
One way: List the process ID in the task manager, and then open the WAS profile log directory and look for serverX.pid.
Question: Is there any other shorter way to get this done?
UseCases: If a particular profile is hung we could right click on the correct process name and create dump file.
While using Websphere Application Server to host each of the CLM applications on a different profile (on the same machine) - If a particular application is running out of memory, how do we find out which java process belongs to which WAS profile.
One way: List the process ID in the task manager, and then open the WAS profile log directory and look for serverX.pid.
Question: Is there any other shorter way to get this done?
UseCases: If a particular profile is hung we could right click on the correct process name and create dump file.
Accepted answer
Hi Krishna,
Try running the following command from a command prompt on your WAS server:
This will create a file in C:\ as temp.html listing all the command line environment details for each java process. In the last line of the commandline property, you should be able to see your WAS profile names and below that should be the process id. You can also use "taskkill" command in windows to kill the java process
I am sure this can be done better with some small scripting, but I think this is quick and easy.
Try running the following command from a command prompt on your WAS server:
wmic /output:c:\temp.html PROCESS where "name='java.exe'" get Processid,Caption,Commandline /format:htable
This will create a file in C:\ as temp.html listing all the command line environment details for each java process. In the last line of the commandline property, you should be able to see your WAS profile names and below that should be the process id. You can also use "taskkill" command in windows to kill the java process
I am sure this can be done better with some small scripting, but I think this is quick and easy.
Comments
Thank you Indradri..
To remember this command sequence is pretty difficult task :), but atleast there is a solution. Its lot better than pickingup one process ID at a time and comparing it against 5-6 (depending on the number of profiles we are working with) server.pid files.
PS: We cannot directly run wmic command windows7 machine (just for trying this out).. but then we dont support our applications on non-server OS anyways.