1

Lately I have been quite concerned about memory issues in ASP.NET.

I have been reading quite a lot articles, made one thread and used a profiler to optimize my application. I also just read the article here about the difference in private bytes, virtual bytes and working set.

So, I understand that private bytes is a poor way of determining the actual use of memory. However, I am going to try a little, as I want to understand my application memory use in depth.

Right now it constantly uses ~55-60mb of private bytes. Does it mean that if I want to run 2.000 users concurrently on my site I need:60mb*2000 = 120gb ram?

I seriously hope someone can come and tell me I am COMPLETELY wrong and I am out of my mind! :)

I also tested a quite basic site with very limited functionality which used ~40-45mb of private bytes, which also seemed like quite a lot.

Community
  • 1
  • 1
Lars Holdgaard
  • 9,496
  • 26
  • 102
  • 182

2 Answers2

1

No; memory usage does not scale linearly with user count.

Most of the memory is (or should be) shared across all users (especially bytecode); the amount of memory used by each additional user should be fairly small.

Also, even if you have 2,000 users, you won't be getting 2,000 requests simultaneously.
The only persistent per-user overhead is session state for each active user.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • Ahhh, god! That's fantastic - you have no idea how glad I am to hear that. Thanks a lot! :-) I will accept answer when I can.. Thanks! – Lars Holdgaard Jan 17 '11 at 00:35
0

ASP.net has a certain amount of overhead as any application on a computer does. This base amount would account for most of the memory you are seeing used.

As to the amount of ram required per session/user etc. well that is extremely biased to the design of your application.

Andrew Harry
  • 13,773
  • 18
  • 67
  • 102