Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Knowing and tracing application memory consumtion and leaks?

Knowing and tracing application memory consumtion and leaks?

Scheduled Pinned Locked Moved C#
questioncssjsonperformance
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chesnokov Yuriy
    wrote on last edited by
    #1

    I've got a long running application what reads some data and store it in Dictioinary field. I persist that class containing dictionary using serialization. During the application run there is small memory consumtion going on about 1 Mb a minute. However serialized object grows about 100 bytes a minute or less. What is the best and fastest way to discover the reason of the leak? Is it possible to determine exact size of that class with Dictionary collection in memory during the program run?

    Чесноков

    D 1 Reply Last reply
    0
    • C Chesnokov Yuriy

      I've got a long running application what reads some data and store it in Dictioinary field. I persist that class containing dictionary using serialization. During the application run there is small memory consumtion going on about 1 Mb a minute. However serialized object grows about 100 bytes a minute or less. What is the best and fastest way to discover the reason of the leak? Is it possible to determine exact size of that class with Dictionary collection in memory during the program run?

      Чесноков

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You'd use a .NET memory profiler like these[^]. If you're looking in TaskManager to tell you what you're app is using, don't. TM is telling you how much memory is RESERVED by the .NET CLR instance running your app, not the app itself.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      C 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You'd use a .NET memory profiler like these[^]. If you're looking in TaskManager to tell you what you're app is using, don't. TM is telling you how much memory is RESERVED by the .NET CLR instance running your app, not the app itself.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        C Offline
        C Offline
        Chesnokov Yuriy
        wrote on last edited by
        #3

        thank you for the link... are there some tools in visual studio or windows to trace the reason of the leak?

        Чесноков

        D 1 Reply Last reply
        0
        • C Chesnokov Yuriy

          thank you for the link... are there some tools in visual studio or windows to trace the reason of the leak?

          Чесноков

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Visual Studio 2010 Premium and Ultimate editions are the only ones with a memory profile built in. All other editions of 2010 and all editions of Visual Studio 2008 and below do not have a memory profiler at all. Windows doesn't have any debugging tools to do this either. But, you are going to have to learn to use the tools effectively. It's not just as simple as starting a profile session, run your app, and Viola!, there's your problem. You have to understand how .NET memory allocation works and how the object involved in your problem behave with respect to memory allocation.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups