Debugging High Memory Utilization Issues

The memory utilization for a particular service on the container application depends on the complexity of service implementation, payload, workload, the number of services deployed on the container application , CPU or memory resources made available to the container .

Prerequisites

Assuming all the components of the engine are tuned for debugging high memory utilization issues on the container application , collect the following data that helps in further debugging and understanding the issues.

Procedure

  1. Capture heap dump on the container application when memory issues are observed on the container application .
    • The heap dumps can be captured by using jmap utility.
      jmap -dump:live,file=memorydump.hprof <PID of container application>
    • The heap dumps can also be captured through JConsole or JVisualVM utilities.

    The heap dump can be analyzed using memory analyzer tool for checking memory leaks and top components of memory.

  2. Capture jstat data for checking the allocation and utilization of different memory pools for 5 minutes run.
    jstat –gc <PID of container application> > jstat_gc.txt
  3. Capture thread dumps for analyzing the thread state and calls. Capture 5 thread dumps at an interval of 5 seconds each. Redirect all the collected threads dumps to separate files.
    • The thread dumps can be captured by using jstack utility shipped with JDK.
      ./jstack <PID of container application> > ThreadDump_n.txt
    • The thread dumps can also be captured through JConsole or JVisualVM.
  4. Capture top CPU consuming threads by using jvmtop utility for 5 minute run.
    For more information about jvmtop utility, see support article KB000034702.
    ./jvmtop <PID of container application> > JVM_topthreads.txt
  5. Capture method level CPU profiling data using jvmtop for 5 minutes run.
    ./jvmtop --profile <PID of > > JVM_CPUProfile.txt
  6. Capture container logs for the test run duration.
  7. Capture the CPU and memory utilization data of the container application for 5 minutes run.
    • The data can be captured through top utility on Unix.
      top –p <PID of container application> > top_application.txt
    • The data can also be captured through JConsole or JVisualVM utilities.
  8. Check the BW_JAVA_OPTS and other run-time parameters with which the container is running. This helps analyze the JVM parameters and other engine tuning parameters.
  9. Capture system configurations of servers such as CPU details, RAM, and number of cores where TIBCO BusinessWorks™ Container Edition applications, external services, and load generator are running. Capture details of /proc/meminfo and /proc/cpuinfo files.
    cat /proc/meminfo and cat /proc/cpuinfo