views:

267

answers:

3

Hello,

I'm planning to do a heap dump with jmap jdk1.5 tool on a production weblogic (10) instance.

Actually there are 3 EAR (perhaps more, don't really know i don't have access) deployed on this weblogic instance.

Someone told me "weblogic creates a JVM for each EAR" Can someone confirm this?

With jmap i need the jvm pid as parameter to do the heap dump... Since i have 3 EAR i guess i have 3 pid so i wonder how to know which pid correspond to which EAR JVM?

+4  A: 

Nope - each Weblogic server (or any java process) runs in it's own JVM with it's own PID. So all your EARs will appear in the same heap dump.

If you have multiple Weblogic server instances running on the same machine, each will have a separate PID and a separate process

JoseK
+1  A: 

As @josek says, you'll have one JVM per WebLogic server, so if all your EARs are under the same WebLogic server you'l only have one pid to dump. But you may still have multiple servers - maybe an admin server and a managed server, maybe other unrelated instances - so if you just do something like ps -ef | grep java (I'm assuming this is on Unix?) you could see a lot of pids, even if you can filter it to your WebLogic's JDK_HOME.

One way to identify which pid belongs to a particular server is to go to the <domains>/servers/<your server>/tmp directory, and in there run fuser -f <your server>.lok. This will list the pids of all the processes related to that server, one of which will be the JVM java process. (May be others for JDBC etc.) One way to find just the java process (and I'm sure someone will point out another, better way!) is something like:

cd <domains>/servers/<your server>/tmp
ps -p "`fuser -f <your server>.lok 2>/dev/null`" | grep java 

If each EAR is in its own server, I guess you'll have to look at config.xml to see which you need.

Alex Poole
A: 

Hey josek told correct you need to get the WebLogic instance and associated PID.

Here I would like to share simple script will help you to get this done:

[http://wlatricksntips.blogspot.com/2010/10/weblogic-instance-name-its-pid.html][1]

Pavan Devarakonda