[23] REFERENCE COUNTING ARCHITECTURES
(Part of the CORBA FAQ, Copyright © 1996)
[23.1] WHAT IS A DISTRIBUTED REFERENCE COUNTING ARCHITECTURE?
[Recently created (7/1997).
Click here to go to the next FAQ in the chain of recent changes]
Distributed reference counting is something typically performed either by a
remote object, the factory for the remote object or possibly by the ORB
itself. The key concept is that something is tracking the number of
connections to a particular remote object. The counter is incremented when
a new reference to the remote object is created. The counter is decremented
when a reference to the remote object is destroyed. The idea is that by
looking at the counter, one can determine if the remote object is still in use.
[ Top | Bottom | Previous section | Next section ]
[23.2] WHY WOULD AN APPLICATION IMPLEMENT A DISTRIBUTED REFERENCE COUNTING ARCHITECTURE?
[Recently created (7/1997).
Click here to go to the next FAQ in the chain of recent changes]
There are several reasons why reference counting might be important.
- Clean-up: An application might like to know that a remote object no longer
has active references. The typical reason is that object that are no
longer in use can be removed from memory. This allows resources
associated with a remote object to be reclaimed. This is especially
important if a distinct remote object exists for each client application.
- Reporting: In many cases it might be helpful to know the usage patterns
for a particular remote object. Without reference counting, an object could
only report the total number of method invocations performed. Information
regarding the number of connected clients or average usage per client would
only be available if a reference counting architecture was in place.
- Load Balancing: In some cases, a client might gain access to a remote
object via an out-of-process factory. The goal of the factory might be to
support clients via a pool of remote objects hosted on different machines.
The factory can choose which remote object to return based on actual usage.
Reference counting might be one mechanism for determining a remote objects
load.
[ Top | Bottom | Previous section | Next section ]
[23.3] DOES CORBA SUPPORT DISTRIBUTED REFERENCE COUNTING ARCHITECTURES?
[Recently created (7/1997).
Click here to go to the next FAQ in the chain of recent changes]
CORBA does not directly support distributed reference counting. This was a
conscious decision on the part of its designers. While CORBA does not
directly support reference counting, it is possible to build reference
counting into a particular distributed object architecture. This can be
done through an explicit session management facility which can be exposed
through factories or other remote interfaces. While it is possible to
design reference counting into an application, it is the burden of the
application designer/developer to ensure that such an approach is
implemented correctly.
[ Top | Bottom | Previous section | Next section ]
[23.4] WHAT PROBLEMS MIGHT BE ASSOCIATED WITH A DISTRIBUTED REFERENCE COUNTING ARCHITECTURE?
[Recently created (7/1997).
Click here to go to the next FAQ in the chain of recent changes]
The designers of the CORBA specification chose not to support distributed
reference counting for several specific reasons.
- Error prone: Distributed reference counting relies upon the developer to
properly increment and decrement the reference counting mechanism. Failure
to do so can result in disappearing objects or orphaned objects that have no
users.
- Performance problems: In some cases, clients terminate abnormally without
properly releasing references. This results in reference counts not being
decremented. In order to survive such situations without leaving remote
object orphaned, objects must occasionally ping clients to determine if
they are alive. This can result in excessive network traffic and cause
performance problems.
- No support for persistent object references: CORBA allows object
references to be stringified, stored, and objectified without losing their
remote context. An object reference can be considered valid even if its
connection terminates or if the remote object is destroyed. Supporting
both persistent object references and reference counting is very
difficult since counting stringified object references may not be possible.
Some distributed frameworks such as DCOM are built around a distributed
reference counting architecture.
[ Top | Bottom | Previous section | Next section ]
[23.5] IS THERE AN ALTERNATIVE TO DISTRIBUTED REFERENCE COUNTING ARCHITECTURES?
[Recently created (7/1997).
Click here to go to the next FAQ in the chain of recent changes]
Yes: connection-less architectures.
With a connection-less architecture, an object does not know any thing about
the object references which refer to it, including the number of references.
This is the style found most often on the World Wide Web.
[ Top | Bottom | Previous section | Next section ]
E-mail us
[ CORBA FAQ
| Table of Contents; Exhaustive; Alphabetical
| Subject index
| About the authors
| ©
| TM
| Download your own copy ]
Revised Sep 8, 1997