High Memory usage Issue RRS feed

  • Question

  • Dear All:

    My Problem is:

         There's a project with C#/C++/C language, C# is used for Bussiness Logic,C is used for Comminication(encode/decode) with Device, and C++ as a adapter between C# and C.

        So, It will be two heaps in the process. One is GC Heap, another is Native Heap. When run for a long time, the memory Usage is very large,then I use the Debugdiag to dump the process, and analyse the memory. It seems that no memory leak.

    GC Heap is 680MB

    Commit Size 695MB

    Reserved Size 300MB

    But, About 540MB is Free

    In this situation, the native heap is no more memory to alloc (total is 2 GB address with 32bit app).

    My question is:

    1.  in the extreme situation, native heap is very small , when i call "new" operator on native heap ,it will fail.

    2. why the gc heap do not free some segment of the VM if useless.

    Below is my server configuration

           Hardware Environment: 4CPU(8 core) + 16G Memory

           OS:Windows Server 2008 R2 SP01

           .Net Framework 4 x86(32bit)

     Best Regards.

    Saturday, November 9, 2013 5:25 AM


  • If I understood you right you have many GC segments allocated but they are of no use now. You could try to call GC.Collect several times to make the GC aware of some free memory. But it also may be that this is not possible because in the segments are still some objects pinned.

    For some tools like VMMap and Xperf you can check out this post: http://geekswithblogs.net/akraus1/archive/2013/11/05/154556.aspx where I did analyze high memory issues with Workflow foundation.

    If object pinning is the issue you can check with Windbg and !DumpHeap -stat to see which objects are pinned. Then you need to do some leg work to check if in each of your GC segments something hides.

    Sunday, November 10, 2013 2:02 PM