Sql-server – How to know which application is consuming the ram

memorymemory usagesql serverteam-foundation-serverwindows-server-2008

I have the following process list and memory consumption (reported thru process explorer) on a 2008 R2 server with SQL, TFS and some other tools:

enter image description here

As you can see the system is consuming 3.6 Gb but the process list only shows a big process (the first one [SQL Server]) taking less than 500 Mb and the others are pretty small so I don't know who is taking almost all of the server's memory. Any idea on how to find out the culprit?

Best Answer

The OS doesn't care and you shouldn't either. The OS isn't under memory pressure, it has 500MB free. So it doesn't care how memory is used at all.

The only thing it could do is invest CPU to reclaiming memory. But then one of two things would happen:

  1. That memory wouldn't be used anyway. This would make the effort of making it free a total waste. And this is the most probable outcome, since 500MB is sitting unused already. Having more free memory will have no effect on performance anyway.

  2. That memory would be used. In this case, the effort of making it free would again be a total waste because it would just have to be undone.

Modern operating systems only make memory free when they have absolutely no other choice. It's the worst possible thing they can do with memory as it requires them to do additional work to make use of that memory. They can much more easily transition memory directly from one use to another use without the added wasteful intermediate step of making it free.

It's just doing whatever it happened to be doing last. The OS has no need to reclaim it because the most likely next use for that memory is whatever it was already doing before, and it's already there -- for free.

That said, RAMMap will tell you. But it's utterly pointless to analyze OS memory usage on a machine that's not under memory pressure.