I am trying to figure out the cause of a (possible) memory leak in a complex C# based application. As I cannot debug the problem at runtime due to the system becoming very slow and unstable because of the high CPU and memory usage of the application, I created a dump (dmp) file of the application via the task manager at runtime and then opened that dump for further analysis in my local Visual Studio 2022 instance. When I now try to view the threads of the application at the point of time when the dump was created, it only shows me the call stack until where something async is executed. Everything that happens inside this async execution seems impossible to access. In the call stack it just says that it is waiting for an async process and I should double click or press enter to show async call stacks. However, this doesn't seem to do anything. Am I missing something, or how can I see what is happening inside the async process?
How can I view the async stack traces while debugging a .NET application in Visual Studio?
467 Views Asked by Chris At
1
There are 1 best solutions below
Related Questions in C#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in VISUAL-STUDIO
- The current .NET SDK does not support targeting .NET Core 6.0. Brand new WPF Project VS Community 2022 17.9.5
- Dotnet Run is not working but the application is running in Visual Studio
- Is there a way to support Tailwind @apply in Visual Studio?
- How can I eliminate compile warnings using ZLib in Visual Studio
- C++(or Visual Studio) saving the file will not preserve the original file contents
- VS Community 2022 cannot install dotnet-ef when i try to publish
- Visual Studio 2022 convert spaces to tabs on checkout and back to spaces on checkin
- What should I do if Visual Studio has a restriction on creating files with a long name or a long path to these files?
- Command line error D8036 - not allowed with multiple source files with node-gyp and VS2022
- Migrate Old VS 2015 .suo file to the New VS 2022 DocumentLayout.json
- How to make one executable visual studio, that users can run?
- Use tabs instead of spaces in .csproj file in Visual Studio 2022
- Unity - scrollview/dragging breaks after specific scene inactivity
- How to make Visual Studio 2022 project launch Windows Terminal instead of PowerShell?
- Why is 'EDITBIN /STACK:2097152 w3wp.exe' cmd is giving me an LNK1342 error?
Related Questions in DEBUGGING
- How to pass the value of a function of one class to a function of another with the @property decorator
- Visual Studio C++, breakpoints not stopping debugging DLL (GODOT GDExtention)
- Playwright JS: Getting an error when debugging using line numbers
- C++ skips line when promting for user to enter name of person being added to a string array
- Xcode: Can't Attach to process
- unity navmeshsurface prefab not found or whatever
- It seems to be a bug about "base::trace()" or "methods:::.TraceWithMethods()"?
- How to check reference counting issues when doing direct manipulations of CPython objects?
- How to scroll to the bottom of console window in PyCharm2019 automatically?
- need help debugging prolog
- Is there a way to deactivate (but not delete) conditional breakpoints when debugging?
- How can i debug a python exe which is created by using pyinstaller?
- Increment or Decrement volume programmatically on Xiaomi device adjusts it by 10 steps instead of one step
- Checking request JSON with image data
- Why cannot I set font of `xlabel` in `plotmf` in MATLAB?
Related Questions in ASYNCHRONOUS
- Callback and Microtask Queue of Java Script
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- Musical chairs: How can an asynchronous task cancel a synchronous one in c#?
- Asynchronously add to queue, synchronously process it
- Sending asynchronous requests without a pre-defined task list
- Value of a variable remains unaltered when assigned during a loop
- How to efficiently test some HTTP proxies for accessing a specific domain?
- How do you update Celery Task State/Status to see it in Flower?
- Why use tasks and async await in C# inline?
- NEXTJS14 DRIZZLE : Async issue when trying to post data from component into DB
- Blocking wait on future OUTSIDE of async functions
- save to csv simultaneously opcua datachange notification
- How can I load data from secrets-manager synchronously in TypeScript
- How to avoid timeout of API before ending?
- Conditional Synchronous Import in JavaScript, to export a simple object and not promise, possible?
Related Questions in MEMORY-DUMP
- In python, how to hide sensitive data from getting exposed in memory dump?
- How to perform diffsception (diffing intermediary diff outputs together to filter out irrelevant changes)
- Volatility3: AttributeError: function/symbol 'ARC4_stream_init' not found in library
- How to calculate Retained size (in bytes) of Dictionary<TKey,TValue> in memory dump, using WinDbg?
- Save memory dump edit into an exe file in OllyDbg
- Is it possible to setup unmanaged DLL to generate memory dump files?
- Can someone explain the meaning of android studio memory dump?
- Creating a memory dump that keeps same addresses as RAM, so pointers are still valid
- Dump memory with GDB by register
- dotnet-dump vs createdump analysis
- How do I compare the checksum of a memdump to the source file
- Clear C# String from memory - Angular
- Cleanup output from GDB memory dump
- How to read backtrace /memory dump from a GCC fortify crash?
- How can I view the async stack traces while debugging a .NET application in Visual Studio?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The typical approach to find memory leaks would be to create two or more memory snapshots/dumps and compare them with a memory debugger to see if there is some type of object that seem to only increase in count. I'm not sure stack traces would provide all that much value when trying to find memory leaks.
I have mostly used dotMemory but have no affiliation. I would expect most competent tools to have equivalent functionality, but terminology might be different.
There should be a comparison view where you should be able to sort object by either delta count or delta bytes . This often provides a good indication on what objects are leaking.
Once you have a candidate type you should be able to inspect an instance of that type and some way to view a retention graph where you can view the graph of objects keeping your instance alive. If you see anything suspicious, you should review the code and see if there is some possibility for leaks.
Common reasons are unregistered event handlers. If a object registers an event handler it should also ensure it is unregistered. If it is done in the constructor you should implement IDisposable and unregister in the dispose method, and ensure the object is always disposed. Possibly with a finalizer that only runs for undisposed objects, that logs, or otherwise alerts you, that the object was not disposed.