O'Reilly logo

C# for Java Developers by Adam Freeman, Allen Jones

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lifetime Leases

Objects that derive from System.MarshalByRef don’t live in memory forever. We stated earlier in this chapter that these objects have a default idle period of 5 minutes, after which time the instance will be released. A new instance will be created to service future client requests. The .NET remoting system uses a system of leases to control the lifetime of MarshalByRefObject (MBR) objects.

A lease defines the amount of time that an MBR object will be held in memory before the .NET remoting system releases the instance freeing the resources it consumes. Leases are used by the remoting server to ensure that objects not currently in use are marked for garbage collection.

When a new instance of a server-activated type is created, the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required