Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does .NET reserve so much memory for my application?

When I run my application, in a profiler I see that is uses about 80MB of memory (total committed bytes, performance counter). But when I look at the size of the allocated memory, it is over 400MB!

So my question is, why is .NET reserving so much memory for my application? Is this normal?

like image 520
Martijn Avatar asked Mar 12 '12 15:03

Martijn


1 Answers

you should read Memory Mystery. I had similar questions a while ago and stopped asking myself after reading this. I read other sources, but I cant find now, use keywords "unreasonable allocation of memory windows OS". In a nutshell, OS gives more than your app require depending upon physically available memory resources for e.g. if you are running your app on two machines with different RAM, it can be guaranteed that both these machines will have different memory allocations

like image 139
Krishna Avatar answered Sep 27 '22 18:09

Krishna