I'm running dotMemory command line against an IoT Windows Forms application which requires many hours of tests on a custom appliance.
My purpose is to get memory snapshots on a time basis, while the application is running on the appliance. For example, if the test is designed to run for 24h, I want to get a 10 seconds memory snapshot each hour.
I found 2 ways of doing it:
- Run dotMemory.exe and get a standalone snapshot on a time basis, by using 
schtasksto schedule each execution; - Run dotMemory using the 
attachandtriggerarguments and get all the snapshots on a single file. 
The first scenario it's ready for me, but as it is easy to see, the second one is much better for further analysis after collecting the data.
I'm able to start it by using a command just like:
C:\dotMemory\dotMemory.exe attach $processId --trigger-on-activation --trigger-timer=10s --trigger-max-snapshots=24 --trigger-delay=3600s  --save-to-dir=c:\dotMemory\Snapshots 
Here comes my problem:
- How can I make the command/process stop after it reaches the max-snapshot value without any human intervention?
 
Reference: https://www.jetbrains.com/help/dotmemory/Working_with_dotMemory_Command-Line_Profiler.html