4. Refresh SSH session window to enable dotnet-dump command.
5. Check dotnet process id. In example below, process id of the web app is 29.
ps aux | grep dotnet
6. Change directory to persistent storage.
7. Capture dotnet core dump.
dotnet-dump collect -p [process-id] --type Full --diag
Specifies the process ID number to collect a dump from.
Specifies the dump type, which determines the kinds of information that are collected from the process. There are three types:
Full - The largest dump containing all memory including the module images.
Heap - A large and relatively comprehensive dump containing module lists, thread lists, all stacks, exception information, handle information, and all memory except for mapped images.
Mini - A small dump containing module lists, thread lists, exception information, and all stacks.
Enables dump collection diagnostic logging.
8. Once capture completed, we should be able to see dump file in the "/home/LogFiles" directory.
Unlike capturing memory dump on Windows Web App with procdump,dotnet-dump tool offers manual dump capture only by the time of writing. In other words, we cannot configure conditional capture to automatically collect memory dump based on cpu threshold, memory threshold or occurrence of exceptions, like we usually do on Windows Web App. Manual capture is needed in those scenarios.