tags:

views:

156

answers:

7

The software I wrote (C#, .NET, VS2008) does some simple image processing. I operates on the single image. Surprisingly its consuming more than 150MB which should not be the case.

I want to know whats making it use this much of resources. Are there any tools that will help?

A: 

There are many .NET memory profilers out there:

http://www.google.com/search?q=.net+memory+profiler&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla%3Aen-US%3Aofficial&client=firefox-a

I would also add that your .NET program is going to allocate memory for what it needs internally, as well as extra memory that it will hang on to and use as needed. I am no .NET expert, but the memory use is not going to be as deterministic as it would be if your program were written in an unmanaged language.

Ed Swangren
A: 

There are various memory profilers such as ANTS and other that can help or you can just get WinDbg + Sos and look at the heap.

Brian Rasmussen
+1  A: 

Here is my list:

  1. Visual Studo 2008 (and here)
  2. Equatec
  3. dotTrace
Richard Nienaber
A: 

As a related aside, make sure your app isn't writing lots of information to Trace, it adds up! I got caught out with a batch operation that logged SQLs run, trouble was I was processing millions of records... boom! (this was asp.net)

Will
A: 

I believe that will help you.

JetBrains dotTrace : http://www.jetbrains.com/profiler/

Erkan BALABAN
A: 

Try VMMAP:

VMMap is a process virtual and physical memory analysis utility. It shows a breakdown of a process's committed virtual memory types as well as the amount of physical memory (working set) assigned by the operating system to those types. Besides graphical representations of memory usage, VMMap also shows summary information and a detailed process memory map. Powerful filtering and refresh capabilities allow you to identify the sources of process memory usage and the memory cost of application features.

VMMap is the ideal tool for developers wanting to understand and optimize their application's memory resource usage.

gimel
A: 

You can use CLR Profiler, for see the memory consumption by your code.

It allows the user to investigate the contents of the manage heap as well as the behavior of the garbage collector, to identify portions of code which use too much memory.

This is free --> http://www.microsoft.com/Downloads/details.aspx?familyid=A362781C-3870-43BE-8926-862B40AA0CD0&displaylang=en

Bhaskar