Mark Ferguson
2010-06-01 04:25:17 UTC
Hi,
We are seeking advise on how to resolve a server-side memory leak with omniORB 4.1.3
Symptom observed:
- The response buffer allocated by the server is never freed
Seaking advise on:
- What we need to change to ensure that the server does not leak memory
Summary of software used:
- Client (1) implementation omniORB 2.8 (win32)
- Client (2) implementation omniORB 4.1.3 (AIX 5.3)
- Server implementation omniORB 4.1.3 (AIX 5.3)
Note: Changing the win32 client implementation is not an option at this stage.
IDL Summary:
Service.idl
long getChildrenList(in string req_data,
in long req_data_len,
out string response_data,
out long response_data_len)
raises (EInternalError, EGetChildrnListFailed);
ServiceSK.cc
::CORBA::Long _objref_Service::getChildrenList(const char* req_data, ::CORBA::Long req_data_len, ::CORBA::String_out response_data, ::CORBA::Long& response_data_len)
Client side summary:
void * _outBuf;
char * reply;
...
CORBA::Object_var obj = orb->string_to_object(szIOR);
Service_var connVar = Service::_narrow(obj);
...
{
// the corba system may soon alloc a new output buffer,
// free the current one if it exists
CORBA::string_free((char *) _outBuf);
...
connVar -> getChildrenList ((char *)_inBuf, _inBufSize, reply, outBufSize);
_outBuf = reply;
...
}
Server side summary:
Service_i.cpp
CORBA::Long Service_i::getChildrenList (const char *req_data,
CORBA::Long req_data_len,
CORBA::String_out response_data,
CORBA::Long &response_data_len)
{
....
CORBA::Long ret = serverImplGetChildrenList(req_data, req_data_len, response_data, response_data_len, resv );
...
}
ServerImpl.cpp
int serverImplGetChildrenList( const char * request_data,
long request_data_len,
char * & response_data, // should this be CORBA::String_var & response_data, or is there more required?
long & response_data_len,
char* reserved)
{
...
// allocate memory for the response on the heap
response_data = new char [1024000];
// populate the response buffer with data
...
return SUCCESS;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100531/93a1e253/attachment.htm
We are seeking advise on how to resolve a server-side memory leak with omniORB 4.1.3
Symptom observed:
- The response buffer allocated by the server is never freed
Seaking advise on:
- What we need to change to ensure that the server does not leak memory
Summary of software used:
- Client (1) implementation omniORB 2.8 (win32)
- Client (2) implementation omniORB 4.1.3 (AIX 5.3)
- Server implementation omniORB 4.1.3 (AIX 5.3)
Note: Changing the win32 client implementation is not an option at this stage.
IDL Summary:
Service.idl
long getChildrenList(in string req_data,
in long req_data_len,
out string response_data,
out long response_data_len)
raises (EInternalError, EGetChildrnListFailed);
ServiceSK.cc
::CORBA::Long _objref_Service::getChildrenList(const char* req_data, ::CORBA::Long req_data_len, ::CORBA::String_out response_data, ::CORBA::Long& response_data_len)
Client side summary:
void * _outBuf;
char * reply;
...
CORBA::Object_var obj = orb->string_to_object(szIOR);
Service_var connVar = Service::_narrow(obj);
...
{
// the corba system may soon alloc a new output buffer,
// free the current one if it exists
CORBA::string_free((char *) _outBuf);
...
connVar -> getChildrenList ((char *)_inBuf, _inBufSize, reply, outBufSize);
_outBuf = reply;
...
}
Server side summary:
Service_i.cpp
CORBA::Long Service_i::getChildrenList (const char *req_data,
CORBA::Long req_data_len,
CORBA::String_out response_data,
CORBA::Long &response_data_len)
{
....
CORBA::Long ret = serverImplGetChildrenList(req_data, req_data_len, response_data, response_data_len, resv );
...
}
ServerImpl.cpp
int serverImplGetChildrenList( const char * request_data,
long request_data_len,
char * & response_data, // should this be CORBA::String_var & response_data, or is there more required?
long & response_data_len,
char* reserved)
{
...
// allocate memory for the response on the heap
response_data = new char [1024000];
// populate the response buffer with data
...
return SUCCESS;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100531/93a1e253/attachment.htm