Using dotMemory on Linux

This KB article will detail how Server Administrators can leverage DotMemory for troubleshooting purposes. DotMemory is a memory profiler that is used to take snapshots of your RAM, which can be used to identify Memory issues such as memory leaks.

NOTE: This will normally cause the service to lockup when it is taking a snapshot of what the memory is doing. IT will also use up space on your drive equal to the amount of MEM being used. For Example, if the MEM that is being consumed by SmarterMail is 10 GB, the dotTrace file is going to be 10 GB in size. The service will be unavailable during this time. 

  1. Download the DotMemory console tools to the directory you are currently in. 
    1. To get the current download link you can go https://www.jetbrains.com/dotmemory/download/download-thanks.html?platform=linux#
    2. On this page, you will see an option to get a direct link. At this time the direct link is, https://download.jetbrains.com/resharper/dotUltimate.2025.1.4/JetBrains.dotMemory.linux-x64.2025.1.4.tar.gz. This may show up with a get string attached to it, you can remove that. 
    3. This will get you a download link to use. 
    4. Example: 
      1. wget https://download.jetbrains.com/resharper/dotUltimate.2025.1.4/JetBrains.dotMemory.Console.linux-x64.2025.1.4.tar.gz
  2. Extract the DotMemory console tools. 
    1. Create a directory to store the files in 
    2. sudo mkdir -p JetBrains
    3. Extract the files
    4. sudo tar -xvzf JetBrains.dotMemory.Console.linux-x64.2025.1.4.tar.gz -C JetBrains
  3. Generate the DotMemory trace and save it to /home/smartertools/staging/traces/ (tailor this for your environment/user.). The command-line triggers can be found here (https://www.jetbrains.com/help/dotmemory/Working_with_dotMemory_Command-Line_Profiler.html#)
    1. Creating a directory with space to save the file 
    2. sudo mkdir /media/mynewdrive/JetBrains-dotMemory-Traces
    3. run the trace
    4. sudo JetBrains/dotmemory get-snapshot MailService --all --save-to-dir=/media/mynewdrive/JetBrains-dotMemory-Traces
    5. Example of what the output will look like 
    6. root@localhost:~# JetBrains/dotmemory get-snapshot MailService --all --save-to-dir=JetBrains-dotMemory-Traces
      Performs memory profiling of .NET applications
      
      Found 1 process(es):
        [1967327] MailService
      
      Attaching to [1967327] MailService runtime...
      Profiler connected. PID:1967327, Core CLR runtime v8.0.10.0
        ATTACHED. Getting snapshot...
        [PID:1967327] Saving snapshot... ~7.18 M objects
        [PID:1967327] SNAPSHOT #1 SAVED.
        [PID:1967327] Processing snapshot #1...
        [PID:1967327] SNAPSHOT #1 READY.
      Profiler disconnected. PID:1967327
      
      Saving workspace...
      WORKSPACE SAVED
      file:///root/JetBrains-dotMemory-Traces/[1967327]-MailService.2025-07-15T19-05-18.647.dmw
  4. Collect the DotTrace profile noted in the console output, zip it, and send it over to us or upload to file storage and provide a link.
    1. Zip the file, deleting the original, freeing up space. 
    2. zip 20250715-DotMemory \[1967327\]-MailService.2025-07-15T19-05-18.647.dmw -m