c# memory leak analyze -


I'm breaking my head, but still I can not get the solution. I run these codes and the NAT Memory Profiler Analyzed with. This showed me that an example of the intertity [] has not been collected. But I am clearing the list and setting it to blank. How can I do this to collect garbage? Am I doing something wrong here?

Edit: I set b = zero and amp; GC Calling (GC Maxjunction); But the same result
Editing 2: Net Memory Profiler & amp; Ants Memory Profiler

Please help me.

I'm using code here,

  public class IntEntity {public int value {get; Set; }} Public Essentials Support {secure list & lt; IntEntity & gt; Number; Public base () {} public abstract zero populate (); Public integer amount () {numbers = new list & lt; IntEntity & gt; (); Populate(); Int sum = 0; Forex currency (number difference in numbers) {sum + = number.Value; } Numbers Clear (); Numbers = null; Refund Amount; }} Public Class Child: Base {Public Override Zero Populate () {numbers.Add (New IntEntity () {Value = 10}); Numbers Add (New IntEntity () {value = 20}); Numbers Add (New Difference () (Value = 30}) Add Numbers (New IntEntity) {value = 40});}} Base B = New child (); MessageBox.Show (.B.Sum () ToString ( ); B = Null; GC.Collect (GC.MaxGeneration);  

Alt text

alt text

you add You can set GC.Collect () after setting the numbers as zero and it should probably disappear from your profile.

You should keep in mind that for general testing purposes Only garbage collection should motivate


Comments