Click here to Skip to main content
Click here to Skip to main content

.NET Interview Questions: Mention LeaseTime, SponsorshipTime, RenewonCallTime and LeaseManagerPollTime

, 8 May 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
This is a very important question from a practical implementation point of view.

This is a very important question from a practical implementation point of view. Companies who have specific requirement for Remoting projects will expect this question to be answered.

In normal .NET environment objects garbage collector manages lifetime. However, in remoting environment remote clients can access objects, which are out of control of garbage collector. Garbage collector boundary is limited to a single PC on which framework is running; any remote client across physical PC is out of control of GC (Garbage Collector).

This constraint of garbage collector leads to a new way of handling lifetime for remoting objects, by using concept called as “LeaseTime”. Every server side object is assigned by default a “LeaseTime” of five minutes. This lease time is decreased at certain intervals. Again, for every method call a default of two minutes is assigned. When I say method call means every call made from client. This is called as “RenewalOnCallTime”.

Let’s put the whole thing in equation to make the concept more clear.

Total Remoting object life time = LeaseTime + (Number of method calls) X (RenewalTime).

Then default Remote Object Life Time = 5 + (1) X 2 = 10 minutes (Everything is in minutes)

When total object lifetime is reduced to zero, then it queries the sponsor that should the object be destroyed. Sponsor is an object, which decides should object Lifetime be renewed. So it queries any registered sponsors with the object, if does not find any then the object is marked for garbage collection. After this garbage, collection has whole control on the object lifetime. If we do not foresee how long a object will be needed specify the “Sponsorship Timeout” value. Sponsorship Timeout is time unit a call to a sponsor is timed out.

“LeaseManagerPollTime” defines the time the sponsor has to return a lease time extension.

View the following video on Garbage Collector, Gen 0, 1 & 2 asked in C# .NET interview: video.

Learn more on .NET interview questions.

From more on author’s blog related to .NET interview questions click and visit.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Shivprasad koirala
Architect http://www.questpond.com
India India

I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small
E-learning company in India. We are very much active in making training videos ,
writing books and corporate trainings. Do visit my site for 
.NET, C# , design pattern , WCF , Silverlight
, LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server  training 
and Interview questions and answers


Comments and Discussions

 
GeneralMy vote of 1 PinmemberdvptUml3-Mar-13 2:48 
GeneralRe: My vote of 1 PinmvpShivprasad koirala3-Mar-13 5:01 
GeneralMy vote of 5 PinmemberRupeshKumar14-May-12 6:11 
QuestionRemote Object Life Time PinmemberBiegal9-May-12 5:06 
AnswerRe: Remote Object Life Time Pinmembersrihari.sridharan13-Nov-12 21:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.1411023.1 | Last Updated 8 May 2012
Article Copyright 2012 by Shivprasad koirala
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid