Search found 5 matches

by Shawn
Thu Sep 22, 2016 2:54 am
Forum: Using .NET Memory Profiler
Topic: Why trigger a SnapShot will still drop down the memory.
Replies: 1
Views: 6710

Why trigger a SnapShot will still drop down the memory.

Hi, I have a GC.Collect() at end of my testing program, I understand this is a blocking call and will free all un-reachable objects, if my program have no extra work any more, then the used memory should stayed in a fixed value, and this has been proved via the Graph and statistics . But at this poi...
by Shawn
Tue Nov 19, 2013 2:58 am
Forum: Using .NET Memory Profiler
Topic: Why calculate string type's duplication instance
Replies: 7
Views: 13541

Re: Why calculate string type's duplication instance

Somehow it seems like you do create duplicate instances of your string. As I have not seen your code I cannot explain how it happens, but I believe it's unlikely that the runtime somehow creates implicit copies of the same string or that the profiler finds non-existent copies of the string. Are you...
by Shawn
Mon Nov 18, 2013 5:44 am
Forum: Using .NET Memory Profiler
Topic: Why calculate string type's duplication instance
Replies: 7
Views: 13541

Re: Why calculate string type's duplication instance

No, the profiler does not exclude the interned strings. If you have 10,000 duplicate strings and one of the strings is interned, it will still be presented as 10,000 duplicate strings and not 9,999. Note that there can only be one interned string in a set of duplicate strings. Your example should n...
by Shawn
Fri Nov 15, 2013 2:03 am
Forum: Using .NET Memory Profiler
Topic: Why calculate string type's duplication instance
Replies: 7
Views: 13541

Re: Why calculate string type's duplication instance

1. It is only literal strings in an assembly that is interned by default. If you create a string by any other means, e.g. by using StringBuilder or concatenating string, the resulting string will not be interned. You can intern the string manually by calling string.Intern, but that can have serious...
by Shawn
Thu Nov 14, 2013 7:46 am
Forum: Using .NET Memory Profiler
Topic: Why calculate string type's duplication instance
Replies: 7
Views: 13541

Why calculate string type's duplication instance

Hi, First of all, I love this tool very much and will buy soon once I get approved from manager(already under process). I have 2 questions: 1. All the string instances will be default interning in .NET(I use .NET 3.5), so even I created many duplicate content strings, they actually reference to one ...