How to take a heap dump on a container gateway install and how to run our DCT tool on a container gateway.
Release : 10.1
Component : CA API GATEWAY
Generating a Heap dump is not officially available via DCT for docker but with our 10.1 image it can be captured with the jcmd within the java_home directory of the docker image.
Enter directly into the gateway pod and then determine the gateway pid.
$ docker exec -it -u 0 GatewayContainerID /bin/bash
# /usr/lib/jvm/default-jvm/jcmd/bin/jcmd GatewayPID GC.heap_dump /tmp/dump.hprof
8:
Dumping heap to /tmp/dump.hprof ...
Regarding the DCT tool:
To run it
kubectl exec <your pod> "/usr/dct/collect.sh -m gateway -f <your dct output location>"
example : kubectl exec -n Namespace PodName -- /usr/dct/collect.sh -a -f /tmp
To download it
c:\>kubectl cp gw-dcnew-858ff48757-t5zrd:/tmp/ Temp
tar: Removing leading `/' from member names
tar: /tmp/.java_pid7: socket ignored
To connect to container
kubectl exec --stdin --tty PodName -- /bin/bash
kubectl exec --stdin --tty <podId> -n <namespace> -- /bin/bash # logged into container Shell
ps awwx | grep Gateway.jar # To get ProcessID
/usr/lib/jvm/default-jvm/jcmd/bin/jcmd <GwyProcessId> GC.heap_dump /tmp/dump.hprof # Generate heap dump
Exit Container Shell
kubectl cp -n <namesspace> <podId>:/tmp/ . # Copy heap dump from Container to Client machine.