tags:

views:

89

answers:

3

Hello friends!

I am having an asp.net 2.0 web application running from Visual studio 2005. The initial memory consumption for aspnet_wp.exe is about 2K. As i navigate different pages having GridView and other controls the size is increasing (around 47K).

My question is, if i am closing the browser why not the memory is released or even if i close the VS2005 still the memory consumption is the same.

I have checked all open db connections and closed them carefully, still the problem exists. Could some one guide me why this is happening and what is the resolution?

Thanks for sharing your valuable time.

+1  A: 

closing the browser or closing the VS2005 doesn't necessary trigger the garbage collection to collect the memory. How long will the memory stay high? What happens after 5, 10 minutes?

J.W.
Thanks J.W.! So do you mean its the issue related with garbage collection or should i call GC explicitly?
IrfanRaza
it's not an issue, when GC feels it needs to start garbage collection, it will start one. Don't call GC explicitly if you don't fully understand it.
J.W.
+1  A: 

AppDomains can take up to 30 seconds to completely shut down. This means that it could take up to 30 seconds for all memory to be freed from the process once you shut down the host server.

Andrew Hare
Thanks Andrew! but even after waiting for 10 minutes the size remains still the same.
IrfanRaza
+1  A: 

Closing the browser only does things on the client side. The ASP.NET worker process is a server process that stays active waiting for new hosts. I don't claim to know much about how all of that works but I can say that the server process isn't going to throw everything away especially if it has loaded libraries into memory to be made available for other client connections.

bdwakefield
Thanks buddy! You are absolutely right, but when i close the process tree from task manager i found that all the active db connections are closed. So in my opinion this might be happening because of the connection spooling.
IrfanRaza
Accept the answer if it worked :) ty.There are also time outs associated with your connections and the IIS process will keep those open till the connection times out. You should be explicitly closing them when you are done with them anyway.
bdwakefield