How to set Allocation Data Mode to FULL using Command Line


I'm creating snapshots using the command line tool. But it appears the Allocation Data mode is only being set to sampled. I see the green dotted line instead of a solid green line on the graph. What command can I use to make the snapshot FULL rather than Sampled?



Sampling is default allocations mode because it doesn't significantly impact application performance. You can use this argument to enable full allocation mode:

      [--collect-alloc|-c]            Collect full allocation data (impacts performance) If not specified, the profiler will collect sampled allocation data. Note: Collecting sampled data is not supported for Linux arm32 and applications targeting .NET 3.1 or earlier on Linux and macOS.

Please read more information about dotMemory clt commands using dotmemory help start.

Full command line looks like:

dotmemory start -c <Path to app.exe>

You can also control the profiling session by writing the following service messages to stdin:

  ##dotMemory["force-gc", {pid:[PID]}]                  to force garbage collection
  ##dotMemory["get-snapshot", {pid:[PID]}]              to get a memory snapshot
  ##dotMemory["collect-allocations-on", {pid:[PID]}]    to collect full memory allocation data (instead of sampled data)
  ##dotMemory["collect-allocations-off", {pid:[PID]}]   to collect sampled memory allocation data (instead of full data)






Thanks for the feedback. I was not able to get to work however. It kept saying that the “collect-allocations” is not supported. I tired it on the example Game that Jetbrains to provides. 

Here are some examples:


Full allocations are only available when you start your application from the beginning, not in attach mode.


How do you know which can commands to use when using dotMemory help? It seems that it will only provide information on certain key words but not others.

Thanks very much!!


So I used the start command to profile GameOfLife. It connected, profiled and then disconnected. The application did not appear so I can interact with it. I could not press any buttons or take any additional snapshots. It just ended.

Is there anything else I can do? Why is it doing this? 

What I was expecting was an application that would appear on the screen, I can press buttons, I could type other commands to take additional snapshots, and then end the  profiling session.  Am I missing something?


Please add these flags to the command line and collect logs for us. The logs will be located in %temp%\JetLogs folder:

--log-level=Trace --core-log-mask=Com,Api,Bridge,MetaDataGt,ThreadGt,ClassGt,MethodFilterGt,FieldResolverGt,ClassRecoveryGt,AppDomainRecoveryGt,ThreadRecoveryGt,MemoryDumpGt,GcCb,GcReferencesCb,ModuleCb,ThreadCb,ExceptionCb,ClassCb,AppDomainCb,AssemblyCb

Sorry, what does %temp%\JetLogs mean?



%temp% is the path to the temp directory on Windows.
If you paste “%temp%\JetLogs” to the address bar of Windows Explorer, it will open the desired folder.


Please sign in to leave a comment.