Profiler vs virtual memory size

I'm profiling a 1.1 .Net desktop application. When I run application in the ANTS memory profiler, it says the application has about 8MB of active memory objects.

When I run the application standalone, VM Size is task manager is 70MB.

Why is there such a big difference? How can I find out what is made up of the 70MB?



  • Brian DonahueBrian Donahue Posts: 6,590 New member
    That's a good question. This is a bit outside the scope of ANTS Profiler, which is designed to show you where you can make improvements to your code.

    To optimize your memory footprint, there are a few things to consider outside of code profiling such as making sure you're not loading in dlls that you aren't using and removing any unused embedded resources from your projects.

    While I can't recommend a single tool that would help you, I'd look into sysinternals Process Explorer, a free tool that they make. It extends Task Manager to show more information about processes such as file handles, threads, and dlls that have been loaded into the process.

    The total memory of an application also depends on the amount of memory automatically allocated to it by the runtime, which can be an arbitrary amount. I had once asked if there is a formula that the Runtime uses to figure out how much memory will be allocated by a managed code application and the answer that I got was basically 'as much as it can get'. Maybe there is a way to tighten the allocations down manually but I can't say how.
Sign In or Register to comment.