Why dotmemory cannot collect memory traffic and track trace information when trying to connect to a direct process

I have an asp.net application, before the application can provide services, it needs to build a very large local cache. I want to profile a specific piece of code. My application is quite huge, I do not want to completely profile it. I just want to profile the path of the code that serves the request.

I am starting to use dotMemory to track application memory usage. When I try to connect to a process,

profiler settings from two check boxes in the dialog box: 1) collect every N-th object 2) the collection of memory traffic cannot be checked.

Why dotMemory n't dotMemory collect traffic and traffic information when trying to connect to a direct process?

I am also trying to use the profiler API.

 private void SomeMethod() { // Here goes your code // ... // Get a snapshot if (MemoryProfiler.IsActive) MemoryProfiler.Dump(); } 

I can get a snapshot, but the application starts first, and then after that profiler. I also cannot get memory traffic.

+6
source share
1 answer

This is the limitation of profiling Microsoft api . The COR_PRF_ENABLE_OBJECT_ALLOCATED flag must be set before the start of the profiling process.

I would recommend you try JetBrains dotTrace in "timeline" mode if you cannot run the application in dotMemory. It uses ETW providers to collect traffic statistics and can help you with your problem.

ps, when you use api profiling, be sure to call MemoryProfiler.EnableAllocations if you want to collect stack traces.

+4
source

Source: https://habr.com/ru/post/979619/


All Articles