Calling Garbage Collector explicitely

Posted by Webmaster under ASP.NET on 4/30/2007 | Views : 7348 | Status : [Administrator] | Replies : 7
How to call Garbage collector explicitely in ASP.NET with C#?

Best regards,
Webmaster
http://www.dotnetfunda.com



Responses

Posted by: Imdineshk80 on: 1/3/2012 [Member] Starter | Points: 25

Up
0
Down
yes.

Webmaster, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sriramnandha on: 5/23/2012 [Member] Starter | Points: 25

Up
0
Down
SYSTEM.GC.COLLECT()

REGARDS


sriram

Webmaster, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ssj_Kumar on: 7/18/2013 [Member] Starter | Points: 25

Up
0
Down
You can't call Garbage collector explicitely in ASP.NET with C#, you can just say what object need to be removed from memory to Garbage collector via System.GC.Collect(); or Dispose

Garbage collector will get a call only from CLR.



Regards,
Jayakumar Selvakani

Webmaster, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Webmaster on: 6/7/2007 [Administrator] HonoraryPlatinum

Up
0
Down
use following

System.GC.Collect();

Best regards,
Webmaster
http://www.dotnetfunda.com

Webmaster, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Krish_itsme on: 6/21/2007 [Member] Starter

Up
0
Down
By calling gc.Collect() we can call Garbage collector explicitly.

Webmaster, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ramakrishnasri on: 11/14/2007 [Member] Starter

Up
0
Down
hai,
with the help of dispose( ) method u can call the garbage collecter explicitely

EX: obj.Dispose( )
where obj[--]>it can be any object



hope this may help to solve your problem


Webmaster, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja on: 11/14/2007 [Member] Starter

Up
0
Down
Ramakrishnasri,

Calling Dispose method will only let Garbage collector knonw that a particular object is ready to be disposed but it will not call garbage collector explicitely.

I think gc.Collect() is the way.

Regards,
Raja, USA

Webmaster, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response