none
Application Memory: Managed and Unmanaged RRS feed

  • Question

  • Hi,

    We have a .net application (started with .net 1.1 now running on .net 4.0).

    Over period of time the memory consumption is increasing at startup. We are now investigating the reasons for that.

    On Startup memory stats are: (Private bytes)

    • Total bytes - 153 MB
    • Managed - 35.15 MB
    • Unmanaged - 114.6 MB
    • Unused .Net - 2.7 MB
    • Gen1 - 2.2 KB
    • Gen2 - 34 MB
    • LOH - 1.3 MB

    I am actually curious to know what is there in Unmanaged memory. Can anyone please guide here?

    Vinil;

    Thursday, August 9, 2012 8:31 AM

Answers

  • Since we don't know what classes you are using, it's hard to say. But keep in mind that the core .NET Framework does use unmanaged resources for things like the JIT'er and other stuff. It's also possible that your application is holding on to unmanaged resources as class member variables and aren't be properly disposed.

    I also notice that your Gen2 heap is rather large (34MB). These are long-lived objects that have survived 2 GC's and don't get collected very often. You might want to check this out ... though it may be perfectly valid for your architecture and application.


    DevBiker (aka J Sawyer)
    Microsoft MVP - Sql Server (StreamInsight)


    Ruminations of J.net


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

    Thursday, August 9, 2012 3:20 PM

All replies

  • Since we don't know what classes you are using, it's hard to say. But keep in mind that the core .NET Framework does use unmanaged resources for things like the JIT'er and other stuff. It's also possible that your application is holding on to unmanaged resources as class member variables and aren't be properly disposed.

    I also notice that your Gen2 heap is rather large (34MB). These are long-lived objects that have survived 2 GC's and don't get collected very often. You might want to check this out ... though it may be perfectly valid for your architecture and application.


    DevBiker (aka J Sawyer)
    Microsoft MVP - Sql Server (StreamInsight)


    Ruminations of J.net


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

    Thursday, August 9, 2012 3:20 PM
  • We have two big assemblies with 14MB size which gets loaded in the startup.

    Yes you are right 34MB in Gen 2 is big but i have checked this, all of them are static caches, so...

    Still, any tool or trick to look into unmanaged memory?

    Vinil;

    Friday, August 10, 2012 5:23 AM
  • try the tools here: http://download.sysinternals.com/files/SysinternalsSuite.zip

    Ghost,
    Call me ghost for short, Thanks
    To get the better answer, it should be a better question.

    Friday, August 10, 2012 11:23 AM