[omniORB] Server Side Garbage Collection

Ilinykh, Andre AIlinykh@SECTORBASE.COM
Mon, 16 Oct 2000 16:01:10 -0700


The simplest way is using default servant. But omniORB doesn't support
PortableServer::Current now. So I don't have idea how servant can get
ObjectId.
But there is another way.
Keep in memory map of all your servants created by factory A. Set some
timeout 
value for each servant. In separate thread you have to check all servants
each N sec. 
When a servant's timer expires, deactivate corresponding object and delete
servant.

Thanks,
  Andrey

-----Original Message-----
From: jiwils - Jimmy Wilson [mailto:jiwils@acxiom.com]
Sent: Monday, October 16, 2000 3:32 PM
To: 'omniORB Mailing List'
Subject: [omniORB] Server Side Garbage Collection


I have two interfaces.  The first, is a factory object that is used to
create (on demand) server-side implementations of the second interface.

In this example, interface A is the factory interface, and interface B is
the one created by the factory.

interface A
{
    Object  Create( in string strInterface );
	.
	.
	.
};

interface B
{
	.
	.
	.
	Release();
};

My problem is what happens when the client "forgets" to invoke B::Release().
This really causes a memory leak on the server-side.  Or, what happens when
the client machine is accidentally rebooted in the middle of a request?
Either scenario adversely impacts the server.

Is there a CORBA standard way to take care of this problem?  Should the
factory server implementation implement some kind of reference counting
system?  Or is there another method to use to avoid this type of problem.

Jimmy
-- 
James "Jimmy" Wilson
Software Developer, Acxiom Corporation
jiwils@acxiom.com