.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> ASP.Net >> Post New Question Subscribe to Interview Questions

How can U Call garbage Collector method()?

Posted By :Mallikarjuna Chigicherla     Posted Date :August 08, 2010    Points :10   Category :ASP.Net 

GC.Methodname();

please follow this link for full lenghth details:

http://www.developer.com/net/csharp/article.php/3343191/C-Tip-Forcing-Garbage-Collection-in-NET.htm

You can also find related Interview Question to How can U Call garbage Collector method()?  below: 

How Garbage Collector (GC) Works?

  
The methods in this class influence when an object is garbage collected and when resources allocated by an object are released. Properties in this class provide information about the total amount of memory available in the system and the age category, or generation, of memory allocated to an object. Periodically, the garbage collector performs garbage collection to reclaim memory allocated to objects for which there are no valid references.

Garbage collection happens automatically when a request for memory cannot be satisfied using available free memory. Alternatively, an application can force garbage collection using the Collect method.
Garbage collection consists of the following steps:

The garbage collector searches for managed objects that are referenced in managed code.

The garbage collector attempts to finalize objects that are not referenced.

The garbage collector frees objects that are not referenced and reclaims their memory. (More...)

Can we call a base class method without creating instance?

  
Its possible If its a static method.

Its possible by inheriting from that class also.

Its possible from derived classes using base keyword. (More...)

Can we force garbage collector to run?

  
System.GC.Collect() forces garbage collector to run. This is not recommended but can be used if situations arise. (More...)

How do I call a member method and pass a primitive type (Value Type) by reference?

  
Use the ref keyword when declaring the parameter of the method, for example:

public bool GetValue( ref int returnValue );

This will pass the numeric by reference.You can modify the value of returnValue within the body of GetValue and it will persist when the method call returns. (More...)

In .NET Compact Framework, can I free memory explicitly without waiting for garbage collector to free the memory?

  
Yes you can clear the memory using gc.collect method but it is recommended that u should not call this becouse we don't know the exact time when the gc will be called automatic. (More...)

Which method would you call to send an e-mail message and wait for the transmission to complete before proceeding?

  
Select from following answers:

1.MailMessage.Send
2.SmtpClient.Send
3.SmtpClient.SendAsync
4.MailMessage.SendAsync

Correct Answer is:

SmtpClient.Send (More...)

In a Java multithreading program, under what circumstances will you call the yield() method of a thread?

  
1, To give other runnable threads a chance to execute.
2, To start a new thread.
3, To terminate the current thread.
4, To stop the current thread for a specific time.

Answer : 1 (More...)

How can I find out what the garbage collector is doing?

  
Lots of interesting statistics are exported from the .NET runtime via the '.NET CLR xxx' performance counters. Use Performance Monitor to view them. (More...)

What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?

  
Set the DataMember property to the name of the table to bind to. (If this property is not set, by default the first table in the dataset is used.)
DataBind method, use this method to bind data from a source to a server control. This method is commonly used after retrieving a data set through a database query.
(More...)

Can we force garbage collector to run?

  
Yes,
System.GC.Collect() forces garbage collector to run. This is not recommended but can be used if situations arises. (More...)

What is Garbage collector ?

  
Garbage collection consists of the following steps:
? The garbage collector searches for managed objects that are referenced in managed code.
? The garbage collector attempts to finalize objects that are not referenced.
? The garbage collector frees objects that are not referenced and reclaims their memory.

Enforce garbage collection - System.GC.Collect();
(More...)

You are having project1.exe referring util.dll.
Now you wanted util.dll to call a method in project1.exe.

How you will achieve this?

  
Use callback interface

or

Use callback delegates

(similar to button on msft dll calling event on our app) (More...)

How can I find out what the garbage collector is doing?

  
Lots of interesting statistics are exported from the .NET runtime via the '.NET CLR xxx' performance counters. Use Performance Monitor to view them. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend