Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Nancy Thomas   on Apr 06 In Asp.net Category.

  
Question Answered By: Hooriya Khan   on Apr 06

You have to know how ASP.NET works. On everypostback the application recreates
complete Page's control  tree. If any event handler creates something more, even
that is created. After the Response is sent to the user, all resources are
released (as disposed to Garbage Collector -GC). If between your postback
someone else (another user session) needs more memory, garbage collector will
fisically free your resources and by your postback they would have to be
recreated a new. Otherwise they'll be pulled of the memory.

What I wanted to say is that every visit to the page regreates all the controls
to the memory (totaly fresh or not disposed from the GC). So You don't have to
worry so much about users that close their windows, because their resources are
already in the hands of GC. They will be relesed from the memory as soon as the
server will need more memory resources.

It's different with database connections which are a "time consuming" objects.
It's normal to close a connection because it communicates with another app (or
even computer), but the connection object is also disposed to GC and released by
GC when needed.

The only thing to remember is that ASP.NET application creates all the objects
on every request to any page included in the application.
When there are no request, there are also no object instances. But memory can be
"occupied" but is marked as "freeable" by the GC.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on How to use Dispose? Or get search suggestion and latest updates.


Tagged: