Is there a way to force garbage collection?



Is there a way to force garbage collection?..

Answer / Amit Kumar Dohare

In C#, you should never manually force garbage collection as the .NET runtime has its own automatic garbage collector. However, you can encourage the garbage collector to run by allocating large amounts of memory and then allowing the application to idle.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What are delegates in C#?

1 Answers   Winsol Solutions,


Name the two classes are required for implementing a windows service?

1 Answers  


What is Private Constructor? and it’s use? Can you create instance of a class which has Private Constructor?

1 Answers  


What is a cs file?

1 Answers  


what is the difference between convert.tostring() and tostring() functions ?

1 Answers   QuestPond,


Can mvc be used for desktop applications?

1 Answers  


Explain the three services model (three-tier application).

3 Answers   4Cplus,


What is difference between private and static constructor?

1 Answers  


How to achieve polymorphism in c#?

1 Answers  


Is int a class in c#?

1 Answers  


What is a destructor in c#?

1 Answers  


What are destructors in C#?

2 Answers   TryTechnicals Pvt Ltd,


Categories