views:

87

answers:

1

I have recently moved our ASP.NET session state from InProc to a Sql Server solution. I can see session data being inserted into the Sql Server database. I'm monitoring the w3wp.exe process using the "Private bytes" & "# Bytes in all heaps" performance counters.

As I navigate through the website it places data into session, however the private bytes counter still climbs on the server hosting the website? I thought the session data was being written to the database and not being stored in memory? The managed bytes remain constant, and I'm pretty sure all the objects going into the session are managed types.

Does anyone know why the private bytes would still increase?

A: 

Session is just one of the many objects needed for an ASP.Net website. You have moved the session store out of RAM and into SQL but there are plenty of other objects required, not to mention the rendered pages themselves.

AUSteve
Thanks for your reply. The memory consumption however seems to be almost identical to when I still had session objects inproc. The objects I know are fairly large (bad practice I know) that are being inserted into session. Would I not see some sort of decrease in the memory usage?
dnoxs
Those objects session objects have to be in RAM at some point. You wont notice this process's memory usage go down because memory wont be released by the process unless the system needs it. This way unused but reserved memory can be re-used without having to re-allocate. This is an optimisation strategy.
AUSteve
Thanks makes sense.
dnoxs