How to collect a memory dump in Sitecore Managed Cloud Containers in non-production environment


Description

The article describes how to collect a memory dump of a process that is run inside a Sitecore Managed Cloud container in a non-production environment.

Note: To collect a memory dump in a production environment, contact Sitecore Support.

Solution

Notes:

To collect a memory dump:

  1. Download the Sysinternals Suite for Nano Server found on the following page and then unpack the archive to your local folder:
    https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite
    For example, unpack it to C:\ProcDump

  2. Copy the procdump64.exe tool to the Sitecore Managed Cloud container (see How to copy files to/from a container)
    Change the directory to your local folder, for instance to:
    cd C:\ProcDump
    Copy the binary file to your pod, for example:
    kubectl.exe cp procdump64.exe sitecore/cd-76495d74d-x5bmn:procdump64.exe
  3. Connect to your Sitecore pod by running the following commands:
    kubectl exec -it "pod_name" -n "namespace" -- powershell
    For example:
    kubectl.exe exec -it cd-76495d74d-x5bmn -n sitecore -- powershell
  4. Run a PowerShell session within the container (see How to run PowerShell in container) and run the following command to find the required ID of the process:
    (Get-Process | where -Property ProcessName -eq "w3wp").id
  5. Execute procdump as the Sitecore Support engineer has instructed you to do, with on-demand or conditional collection of it:
    .\procdump64.exe -ma <w3wp PID> -accepteula
    For example:
    \procdump64.exe -ma 5688 -accepteula
    \procdump64.exe -ma 5688 -accepteula -c 80 -s 5
  6. After a successful dump collection, exit from the PowerShell session inside the container.
  7. Download the collected dump from the container to the local file system:
    • Move the dump file to C:\inetpub\wwwroot\App_Data\Submit Queue:
      Copy-Item -Path .\w3wp.exe_221202_143040.dmp -Destination '.\App_Data\Submit Queue\'
    • Go to the customer's resource group which ends with aks (for instance, mcca8clf4hbkd1cgvi8aks).
    • Go to file shares. There should be only one file share. If there is more than one, check each of them. The dump should be in the root catalog:
      Graphical user interfaceDescription automatically generated with low confidence
    • Download the .dmp file and delete it immediately afterward.
  8. Zip the dump and upload the zipped archive file to Sitecore Support SharePoint Storage.