How to view .NET interned strings

In CLR 2.0, is there a way to view all the rows that have been interned? I looked at the CLR Profiler APIs and don't see any API calls to monitor when the string gets interned. Also, what is the volume of interned strings? Are interned strings collected when an application domain is unloaded, or do they span application domains?

+3
source share
1 answer

Strings do run by default in .NET 2.0, but which strings become interned and when they can be quite complex. The following article may shed light on the concept:

http://community.bartdesmet.net/blogs/bart/archive/2006/09/27/4472.aspx

Also, regarding your API calls ... make sure you're testing an optimized build. The debug build may not include string interning by default, and therefore you cannot see this happening.

+4
source

All Articles