Friday, February 24, 2012

How to generate a thread dump and heap dump in WebSphere 7 on UNIX

  1. SSH/Telnet to the box.
  2. Get to your WebSphere 7 AppServer/bin directory, e.g. /opt/Was70/AppServer/bin.
  3. Run ./wsadmin.sh -profileName myAppProfile -user mywasuser -password mypassword (substitute your WAS profile name, user and password of course).
  4. This will give you a prompt where you can enter commands.
  5. First, we set a substitution variable with the full name of the object representing our app server:
    set jvm [$AdminControl completeObjectName type=JVM,process=MyServer,*]
  6. Next, we can invoke the dumpThreads and/or generateHeapDump methods of that object:
    $AdminControl invoke $jvm dumpThreads
    $AdminControl invoke $jvm generateHeapDump

  7. By default, the commands above will place the dump files in the root directory for your application profile, e.g. /opt/Was70/AppServer/profiles/myAppProfile.

No comments:

Post a Comment