[omniORB] Server leaks / Threads constantly increasing

Thomas Bednarz tb@smartsol.ch
Mon, 7 Jun 1999 16:26:04 +0200


Hello OmniORB users,

I have a problem with objects I create through a factory on my server. I
currently use version 2.6.1 on NT. When I look in NT's performance monitor
or Task Manager the number of threads constantly increases by one with every
object my Factory creates. These threads get killed only when the client
process terminates. When the client does not need the object anymore it
calls 	
CORBA::BOA::getBOA()->dispose(<theObject>). But this does not decrease the
number of threads!

Here some code sniplets:

To create the object I call a member of my object factory which returns me
the stringified IOR. The client then connects to the created object on the
server through this IOR. The following shows the code of the factory
function:

	AccountManager::NTGlobalGroup_ptr GGObjRef = NULL;
	int line = 0;

	NTGG_S* pGG = new NTGG_S(); 
	if (pGG->isOk())
	{
		pGG->_obj_is_ready(pBOA);
		pBOA->impl_is_ready(0, true);
		GGObjRef = pGG->_this();
	}
	else
	{
		// some error handling and processing ...
	}
     CORBA::String_var str = pORB->object_to_string(GGObjRef);
	CORBA::release(GGObjRef);

	return CORBA::string_dup(str);


Now I can work with the object on the client and all works fine. Once the
client does not need the object anymore it calls a function to distroy the
object on the server. The implementation for this is as follows:

void AccountManagerFactory_S::DestroyNTGGObject (
AccountManager::NTGlobalGroup_ptr  GlobalGroup )
{
	CORBA::BOA::getBOA()->dispose(GlobalGroup);
}


It seems that this is not enough, since the thread which was started from
OmniORB when creating the object is not killed. Also I am not sure whether
all resources on the server are really freed. Could anybody help me and tell
me, how this is done correctly and what I am missing?

Many thanks to everybody.

Thomas

---------------------------------------
SMART Solutions AG
Software Engineering & Consulting
PO Box
Oberwiesenstrasse 5
CH-8304 Wallisellen / Switzerland

Phone:  +41 1 877 72 72
FAX:    +41 1 883 16 79
Web:    www.smartsol.ch
---------------------------------------