Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


can we call the garbage collector to run explicicitly?

Answers were Sorted based on User's Feedback



can we call the garbage collector to run explicicitly?..

Answer / velu s

Yes we can call the Garbage collector explicitly by using
method Collect().

Ex. Create object for the Garbage collector.

GarbageCollector Gc = new GarbageCollector();
Gc.Collect();

Is This Answer Correct ?    16 Yes 1 No

can we call the garbage collector to run explicicitly?..

Answer / rakesh

not required to create object
we can call directly
System.GC.Collect();

Is This Answer Correct ?    6 Yes 0 No

can we call the garbage collector to run explicicitly?..

Answer / sri4u_926

s we can cal Gc explisitly but it Reduces the performance.

Is This Answer Correct ?    3 Yes 0 No

can we call the garbage collector to run explicicitly?..

Answer / prateek

But forcefully calling Garbage collector reduces the
performance. As when CLR runs Garbage collector
automatically it checks all the objects which are not used
for a long time and remove them. But if we use
System.GC.Collect(), it will shift the particular object to
cache. When CLR founds no object which is made to be free
then it will check the cache memory from there it will
remove that very object. So, how it is reducing the performance.

Is This Answer Correct ?    3 Yes 0 No

can we call the garbage collector to run explicicitly?..

Answer / lalitprakash baraik

Yes it is possible.The Gargabe collector class is named as GC and is found in the 'System' namespace.GC is a static class and the Collect method itself is static.There fore you can directly call the Collect() method without creation of an object to access the method.

GC.Collect()

Is This Answer Correct ?    2 Yes 0 No

can we call the garbage collector to run explicicitly?..

Answer / xyz

we can call the garbage collection explicitly but performing a garbage collection is totally dependent on the JVM. So calling System.gc() does not necessarily performing the garbage collection.

--
XYZ

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More Dot Net Framework Interview Questions

What is definingquery in entity framework? : Entity framework

0 Answers  


What is entity framework? : Entity framework

0 Answers  


what is an assembly?

11 Answers  


what is entity framework advantage?

0 Answers   Microsoft,


Explain the role of assembly in the .net framework.

0 Answers  


What is difference between Viewbag and Viewdata in ASP.NET MVC?

0 Answers   NA,


what is entity graph in entity framework?

0 Answers   Microsoft,


What are Action Filters in ASP.NET MVC and its use?

0 Answers  


What happens when you encounter a continue statement inside the for loop ?

1 Answers  


My organization went through the approval process of supporting the .net framework 2.0 in production. Do we need to go through the same process all over again for the .net framework 3.0? Do I need to do any application compatibility testing for my .net framework 2.0 applications?

0 Answers  


What is domain class model?

0 Answers  


What is .net framework & its benefits?

0 Answers  


Categories