[omniORB-dev] Callback memory leak?

Rick Sanden ricksanden at hotmail.com
Wed Sep 15 22:13:33 BST 2004


Hi All

While doing some memory leak testing on my corba server, I noticed my 
callback
referances are never released(even when the client's orb is shutdown). This
causes my server to run out of memory over time.
I based my callback patterns off the callback example included with omniorb.
Is there anyway to force a release or at least limit the number of 
references
saved via the callbacks. My server is embedded and limited on memory.
I have attached a example of how I do callbacks.

Note - I am assuming it is the reference - it turns out to be about 8000 
bytes and
goes away if I shutdown the orb (on the server side). It looks like it leaks 
from the _duplicate

THanks in advance


idl:
----------------------------------------------------------
/**
@memo  New Connection callback interface
@doc This interface creates a new connection to client. */
interface INewConnectionCallBack1
{

void callbackNewConnection1();

};


interface ISpecialInterface
{

  /** Setup internal callbacks */
  EReturnStatus setUpInternalCallBacks(in IInternalErrorCallBack cb,
                                       in INewConnectionCallBack1 nc1,
                                       in INewConnectionCallBack2 nc2,
                                       in INewConnectionCallBack3 nc3,
                                       in INewConnectionCallBack4 nc4,
                                       in INewConnectionCallBack5 nc5);


};


client:
----------------------------------------------------------

// Declare
   /** Connection 1 callback implementation ref */
   telemModule_INewConnectionCallBack1_i
       * mytelemModule_INewConnectionCallBack1_i;

   /** The new connection 1 callback object */
   telemModule::INewConnectionCallBack1_var newConnectionCallBack1;



// Create new connection callback interface
       mytelemModule_INewConnectionCallBack1_i =
         new telemModule_INewConnectionCallBack1_i();

       newConnectionCallBack1 =
           mytelemModule_INewConnectionCallBack1_i->_this();
       mytelemModule_INewConnectionCallBack1_i->_remove_ref();

// Send

     specialInterface->setUpInternalCallBacks(internalErrorCallback.in(),
                                               newConnectionCallBack1.in(),
                                               newConnectionCallBack2.in(),
                                               newConnectionCallBack3.in(),
                                               newConnectionCallBack4.in(),
                                               newConnectionCallBack5.in());



server:
-----------------------------------------------------------
telemModule::EReturnStatus
telemModule_ISpecialInterface_i::
setUpInternalCallBacks(telemModule::IInternalErrorCallBack_ptr cb,
                      telemModule::INewConnectionCallBack1_ptr nc1,
                      telemModule::INewConnectionCallBack2_ptr nc2,
                      telemModule::INewConnectionCallBack3_ptr nc3,
                      telemModule::INewConnectionCallBack4_ptr nc4,
                      telemModule::INewConnectionCallBack5_ptr nc5)
{
   // setup error callback
   sessionManager::getSessionObject()->setErrorCallback(cb);  /* <--- passed 
to a _var */



   /* gNc1 to 5 are declared as _var
      Been declared as global and local - no difference
   */

   gNc1 = telemModule::INewConnectionCallBack1::_duplicate(nc1);
   gNc2 = telemModule::INewConnectionCallBack2::_duplicate(nc2);
   gNc3 = telemModule::INewConnectionCallBack3::_duplicate(nc3);
   gNc4 = telemModule::INewConnectionCallBack4::_duplicate(nc4);
   gNc5 = telemModule::INewConnectionCallBack5::_duplicate(nc5);


   /* do stuff */


   return ok;
}






Server config:
----------------------------------------------------------
omniORB: My addresses are:
omniORB: 192.168.0.2
omniORB: 127.0.0.1
omniORB: Current configuration is as follows:
omniORB:   DefaultInitRef (file) = corbaname::192.168.0.2:10499
omniORB:   DefaultInitRef (args) =
omniORB:   InitRef = NameService =corbaname::192.168.0.2:10499
omniORB:   abortOnInternalError = 0
omniORB:   acceptBiDirectionalGIOP = 1
omniORB:   acceptMisalignedTcIndirections = 0
omniORB:   bootstrapAgentHostname =
omniORB:   bootstrapAgentPort = 900
omniORB:   clientCallTimeOutPeriod = 0
omniORB:   clientTransportRule = * unix,ssl,tcp
omniORB:   diiThrowsSysExceptions = 0
omniORB:   dumpConfiguration = 1
omniORB:   endPoint = giop:tcp::
omniORB:   endPointPublishAllIFs = 0
omniORB:   giopMaxMsgSize = 2097152
omniORB:   giopTargetAddressMode = KeyAddr
omniORB:   id = omniORB4
omniORB:   inConScanPeriod = 0
omniORB:   lcdMode = 0
omniORB:   maxGIOPConnectionPerServer = 100
omniORB:   maxGIOPVersion = 1.2
omniORB:   maxInterleavedCallsPerConnection = 100
omniORB:   maxServerThreadPerConnection = 50
omniORB:   maxServerThreadPoolSize = 10000
omniORB:   nativeCharCodeSet = ISO-8859-1
omniORB:   nativeWCharCodeSet = UTF-16
omniORB:   objectTableSize = 0
omniORB:   offerBiDirectionalGIOP = 1
omniORB:   omniORB_27_CompatibleAnyExtraction = 0
omniORB:   oneCallPerConnection = 1
omniORB:   outConScanPeriod = 0
omniORB:   poaHoldRequestTimeout = 60000
omniORB:   poaUniquePersistentSystemIds = 1
omniORB:   principal = [Null]
omniORB:   scanGranularity = 0
omniORB:   serverCallTimeOutPeriod = 60000
omniORB:   serverTransportRule = * unix,ssl,tcp
omniORB:   strictIIOP = 1
omniORB:   supportBootstrapAgent = 1
omniORB:   supportCurrent = 0
omniORB:   supportPerThreadTimeOut = 0
omniORB:   tcAliasExpand = 0
omniORB:   threadPerConnectionLowerLimit = 9000
omniORB:   threadPerConnectionPolicy = 1
omniORB:   threadPerConnectionUpperLimit = 10000
omniORB:   threadPoolWatchConnection = 1
omniORB:   traceInvocations = 1
omniORB:   traceLevel = 0
omniORB:   traceThreadId = 0
omniORB:   unixTransportDirectory = /tmp/omni-%u
omniORB:   unixTransportPermission =  777
omniORB:   useTypeCodeIndirections = 1
omniORB:   verifyObjectExistsAndType = 0

Client Config
-----------------------------------------------
omniORB: My addresses are:
omniORB: 144.15.110.127
omniORB: 192.168.0.1
omniORB: 127.0.0.1
omniORB: Current configuration is as follows:
omniORB:   DefaultInitRef (file) = corbaname::192.168.0.2:10499
omniORB:   DefaultInitRef (args) =
omniORB:   InitRef = NameService =corbaname::192.168.0.2:10499
omniORB:   abortOnInternalError = 0
omniORB:   acceptBiDirectionalGIOP = 1
omniORB:   acceptMisalignedTcIndirections = 0
omniORB:   bootstrapAgentHostname =
omniORB:   bootstrapAgentPort = 900
omniORB:   clientCallTimeOutPeriod = 0
omniORB:   clientTransportRule = * unix,ssl,tcp
omniORB:   diiThrowsSysExceptions = 0
omniORB:   dumpConfiguration = 1
omniORB:   endPoint = giop:tcp::
omniORB:   endPointPublishAllIFs = 0
omniORB:   giopMaxMsgSize = 2097152
omniORB:   giopTargetAddressMode = KeyAddr
omniORB:   id = omniORB4
omniORB:   inConScanPeriod = 0
omniORB:   lcdMode = 0
omniORB:   maxGIOPConnectionPerServer = 100
omniORB:   maxGIOPVersion = 1.2
omniORB:   maxInterleavedCallsPerConnection = 5
omniORB:   maxServerThreadPerConnection = 100
omniORB:   maxServerThreadPoolSize = 1000
omniORB:   nativeCharCodeSet = ISO-8859-1
omniORB:   nativeWCharCodeSet = UTF-16
omniORB:   objectTableSize = 0
omniORB:   offerBiDirectionalGIOP = 1
omniORB:   omniORB_27_CompatibleAnyExtraction = 0
omniORB:   oneCallPerConnection = 1
omniORB:   outConScanPeriod = 0
omniORB:   poaHoldRequestTimeout = 0
omniORB:   poaUniquePersistentSystemIds = 1
omniORB:   principal = [Null]
omniORB:   scanGranularity = 1
omniORB:   serverCallTimeOutPeriod = 0
omniORB:   serverTransportRule = * unix,ssl,tcp
omniORB:   strictIIOP = 1
omniORB:   supportBootstrapAgent = 1
omniORB:   supportCurrent = 0
omniORB:   supportPerThreadTimeOut = 0
omniORB:   tcAliasExpand = 0
omniORB:   threadPerConnectionLowerLimit = 9000
omniORB:   threadPerConnectionPolicy = 1
omniORB:   threadPerConnectionUpperLimit = 10000
omniORB:   threadPoolWatchConnection = 1
omniORB:   traceInvocations = 0
omniORB:   traceLevel = 0
omniORB:   traceThreadId = 0
omniORB:   unixTransportDirectory = /tmp/omni-%u
omniORB:   unixTransportPermission =  777
omniORB:   useTypeCodeIndirections = 1
omniORB:   verifyObjectExistsAndType = 0





More information about the omniORB-dev mailing list