title: Managed C pointer does not release when finish its instant
body: <p>I have a problems that make a lagre data from the Managed C and use in the C# for the UI.</p>
  
  <p>Here is the example:</p>
  
  <p>Managed side:</p>
  
  <pre><code>public ref class c1
  {
  public:
      c1(void);
      ~c1(void);
      String ^Name;
      double dtata;
  };
  
  
  public ref class c2
  {
  public:
      c2(void);
      ~c2(void);
      !c2();
      String ^Name;
      List&lt;c1^&gt; ^arrData;
  
      void CreateData();
      void Clear();
  
  };
  
  void c2::CreateData()
  {
      arrData=gcnew List&lt;c1^&gt;();
      for(int i=0;i&lt;1000000;i++)
      {
          c1^ d=gcnew c1;
          arrData-&gt;Add(d);
      }
  }
  void c2::Clear()
  {
      if(arrData)
      {
          delete arrData;
          arrData=nullptr;
      }
      GC::Collect();
  }
  </code></pre>
  
  <p>C# side:</p>
  
  <pre><code>void Test()
  {
  using (c2 cx = new c2())
         {
           cx.CreateData();
           cx.Clear();
           cx.Dispose();
  
          }
  }
  </code></pre>
  
  <p>The result is after call Test() function the memory rise from 4MB to 13MB</p>
  
  <p>The question is why the cx does not release from the memory?</p>
  
  <p>Thanks for look</p>