How to collect a memory dump in a container


Description

The article describes how to collect a memory dump of a process running inside a container.

Solution

To collect a memory dump, do the following:

  1. Download the Sysinternals Suite for Nano Server found on the following page and then unpack the archive:
    https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite
  2. Copy the procdump64.exe tool to the container (see How to copy files to/from container).
  3. Run a PowerShell session within the container (see How to run PowerShell in container):
    • Run the following command and note the id of the w3wp process
      Get-Process
      For example:
    • Collect the memory dump on demand:
      .\procdump64.exe -ma <w3wp PID> -accepteula
      For example:
      .\procdump64.exe -ma 852 -accepteula
    Refer to How to collect memory dumps using ProcDump to get more info about procdump usage.
  4. Exit from the PowerShell session inside the container.
  5. Download the collected dump from the container to the local file system (see How to copy files to/from container).
  6. Zip the dump and upload the zipped archive file to Sitecore Support SharePoint Storage.