Bug 44608 - Add profiler events for ref/unref operations on assemblies/images
Summary: Add profiler events for ref/unref operations on assemblies/images
Alias: None
Product: Runtime
Classification: Mono
Component: Profiler ()
Version: master
Hardware: All All
: Normal enhancement
Target Milestone: Future Cycle (TBD)
Assignee: Alex Rønne Petersen
Depends on:
Reported: 2016-09-22 05:48 UTC by Alex Rønne Petersen
Modified: 2017-12-06 15:52 UTC (History)
0 users

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Alex Rønne Petersen 2016-09-22 05:48:17 UTC
This could be used to determine why an assembly/image is still kept in memory if the programmer expected it to be unloaded.
Comment 1 Alex Rønne Petersen 2017-06-20 04:50:07 UTC
After some investigation, this is fairly simple to do: We just instrument the places where MonoAssembly::ref_count and MonoImage::ref_count are modified (4 in total).

However, the new profiler API should be implemented before this.
Comment 2 Alex Rønne Petersen 2017-12-06 15:52:14 UTC
To actually provide useful information, we would need to also provide a 'reason' parameter that says why a reference was added/removed. That would be a quite a bit more work. Since this idea was mostly a nice-to-have with no current use cases, the effort isn't really worth it. Closing.