+

Search Tips   |   Advanced Search

Generating heap dumps manually


Use this task to generate heap dumps manually. This function is not supported on when using a Sun JVM which includes WAS running on HP-UX and Solaris operating systems.

(Windows) [AIX] [Linux] Although heap dumps are generated only in response to a detected memory leak, understand that generating heap dumps can have a severe performance impact on WAS for several minutes. When generating multiple heap dumps manually for memory leak analysis, make sure that significant objects are leaked in between the two heap dumps.

This approach enables problem determination tools to identify the source of the memory leak.

We might want to manually generate heap dumps for the analysis of memory leaks. On a Java virtual machines (JVM) in WAS, we cannot enable automated heap dump generation. We might want to designate certain times to take heap dumps because of the overhead involved. On JVM in WAS, we can manually produce heap dumps by using the generateHeapDump operation on WAS managed beans (MBeans) that are special Java beans.

The WAS wsadmin tool provides the ability to run scripts. Use wsadmin to manage a WAS installation, as well as configuration, application deployment, and server runtime operations. WAS supports the Jacl and Jython scripting languages only. To learn more about wsadmin, see the Starting the wsadmin scripting client topic.

 

  1. Start the wsadmin scripting client. we have several options to run scripting commands, ranging from running them interactively to running them in a profile.

  2. Invoke the generateHeapDump operation on a JVM MBean, for example,

    • Finding JVM objectName:

      <wsadmin> set objectName [$AdminControl queryNames  WebSphere:type=JVM,process=<servername>,node=<nodename>,*]  
      

    • Invoking the generateHeapDump operation on JVM MBean:

      <wsadmin> $AdminControl invoke $objectName generateHeapDump
      
      where,


      Table 1.

      $ Jacl operator for substituting a variable name with its value
      invoke is the command
      generateHeapDump is the operation we are invoking
      <servername> is the name of the server on which you want to generate a heap dump
      <nodename> is the node to which <servername> belongs

 

Next steps

After running the wsadmin command, the file name of the heap dump is returned.

See on finding heap dumps, refer to the Locating and analyzing heap dumps topic. When we have a couple of heap dumps, use a number of memory leak problem determination tools to analyze the problem.

 

Related tasks


Enable automated heap dump generation

 

Related information


Locating and analyzing heap dumps
Diagnose problems using IBM Support Assistant tooling