[omniORB-dev] RE: Callback memory leak?
Rick Sanden
ricksanden at hotmail.com
Sat Sep 18 09:32:49 BST 2004
Looking into to it more, it appears that the tcpip connection being left
open are causing the
memory leak . I have in and out scan periods set to zero. Setting them to
non-zero values clears up the memory leak. I had them set to zero because I
did not want the connections closed during operations. Responses back to the
client need to be very quick. So my next question is - "How long does it
take to reopen a connection if needed". On
average is it > 5 mS
> 10 mS
> 20 mS
thanks
>From: omniorb-dev-request at omniorb-support.com
>Reply-To: omniorb-dev at omniorb-support.com
>To: omniorb-dev at omniorb-support.com
>Subject: omniORB-dev Digest, Vol 11, Issue 3
>Date: Thu, 16 Sep 2004 12:00:01 +0100
>
>Send omniORB-dev mailing list submissions to
> omniorb-dev at omniorb-support.com
>
>To subscribe or unsubscribe via the World Wide Web, visit
> http://www.omniorb-support.com/mailman/listinfo/omniorb-dev
>or, via email, send a message with subject or body 'help' to
> omniorb-dev-request at omniorb-support.com
>
>You can reach the person managing the list at
> omniorb-dev-owner at omniorb-support.com
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of omniORB-dev digest..."
>
>
>Today's Topics:
>
> 1. Callback memory leak? (Rick Sanden)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Wed, 15 Sep 2004 21:13:33 -0500
>From: "Rick Sanden" <ricksanden at hotmail.com>
>Subject: [omniORB-dev] Callback memory leak?
>To: omniorb-dev at omniorb-support.com
>Message-ID: <BAY2-F340VnkB4ltFlm0000e55d at hotmail.com>
>Content-Type: text/plain; format=flowed
>
>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
>
>
>
>
>------------------------------
>
>_______________________________________________
>omniORB-dev mailing list
>omniORB-dev at omniorb-support.com
>http://www.omniorb-support.com/mailman/listinfo/omniorb-dev
>
>
>End of omniORB-dev Digest, Vol 11, Issue 3
>******************************************
More information about the omniORB-dev
mailing list