1

I'm trying to track down the source of some unmanaged memory in a .net 4 application

(this is curiosity...I don't have a major problem with it, I just want to know what it is)

My application currently consists of 1 file: index.html - contains "hello world"

From a memory profiler, I load up index.html and it's consuming very little (in fact, the profile hasn't kicked int)

I then load up /fish (which doesn't exist) and now suddenly we're on a total of about 57MB usage, 54MB of which is unmanaged memory.

This seems like a lot of memory for an empty application - and what's in the unmanaged memory

There is an "Unused memory allocated to .NET" of 2.4MB, which I would totally expect.

Curiously, if I switch the app pool to .net 2, the memory doesn't jump in this way

As I said, I'm curious, but I can't find anything about it online.

Paul
  • 9,409
  • 13
  • 64
  • 113
  • 1
    Won't the .Net environment allocate blocks of up to 60MB from the OS when it runs out of available space. You're missing piece of unmanaged memory is simply not allocated yet and 'freely available' space for the .Net memory engine. – CodingBarfield May 31 '12 at 11:47
  • Oh, really? Was that new in .net 4? – Paul May 31 '12 at 12:08
  • Isn't that the "Unused memory allocated to .NET" part? – Paul May 31 '12 at 12:09
  • Memory management specifics running under asp.net with IIS7 is much different then for a generic Winforms application. It also is highly .Net version dependent and just an implementation detail. There are some memory profilers that can tell you whats inside that huge block of unmanaged memory. But my guess would be that its simply unallocated space that is probably not even really allocated by the OS memory engine. – CodingBarfield May 31 '12 at 12:41
  • The Red Gate ANTS performance testing tool has helped us track down a few hard-to-discover memory management issues. They have a 14 day trial, maybe it can help: http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/ – Josh May 31 '12 at 14:07
  • That's the tool I'm using - it's brilliant, although has this laaarge chunk of unmanaged memory, did you see that when you used it? – Paul May 31 '12 at 15:56
  • There's a learning curve on it but windbg and sos will give you a pretty clear picture of whats going on inside your app. – Kenneth Ito Jun 01 '12 at 00:05

0 Answers0