<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:'Courier New', courier, monaco, monospace, sans-serif;font-size:10pt"><div><font class="Apple-style-span" face="courier, monaco, monospace, sans-serif">Hi,</font></div><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family:courier, monaco, monospace, sans-serif;font-size:12pt;"><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt;"><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><div style="font-family:courier, monaco, monospace, sans-serif;font-size:10pt;"><div><br></div><div>We are seeking advise on how to resolve a server-side memory leak with omniORB 4..1.3</div><div><br></div><div><b>Symptom observed:</b></div><div><div><br></div><div>-
The response buffer allocated by the server is never freed</div><div><br></div><div><br></div><div><b>Seaking advise on:</b></div><div><br></div><div>- What we need to change to ensure that the server does not leak
memory</div><div><br></div><div><br></div><div><b>Summary of software used:</b></div><div><br></div><div><br></div><div>- Client (1) implementation omniORB 2.8
(win32)</div><div>- Client (2) implementation omniORB 4.1.3 (AIX 5.3)</div><div>- Server implementation omniORB 4.1.3 (AIX 5.3)</div><div><br></div><div>Note: Changing the win32 client implementation is not an option at this stage.</div><div><br></div><div><br></div><div><br></div><div><b><span class="Apple-style-span" style="font-size:medium;">IDL Summary:</span></b></div><div><br></div><div><b>Service.idl</b></div><div><br></div><div> long getChildrenList(in string req_data, </div><div> in long req_data_len, </div><div><b> out string response_data, </b></div><div> out long response_data_len)</div><div> raises (EInternalError,
EGetChildrnListFailed);</div><div><br></div><div><b>ServiceSK.cc</b></div><div><br></div><div>::CORBA::Long _objref_Service::getChildrenList(const char* req_data, ::CORBA::Long req_data_len, <b>::CORBA::String_out response_data</b>, ::CORBA::Long& response_data_len)</div><div><br></div><div><br></div><div><br></div><div><b><span class="Apple-style-span" style="font-size:medium;">Client side summary:</span></b></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre;">        </span>void * _outBuf;</div><div><span class="Apple-tab-span" style="white-space:pre;">        </span>char * reply;</div><div><br></div><div>...</div><div><span class="Apple-tab-span" style="white-space:pre;">        </span>CORBA::Object_var obj = orb->string_to_object(szIOR);</div><div><span class="Apple-tab-span" style="white-space:pre;">        </span>Service_var connVar = Service::_narrow(obj);</div><div>...</div><div><span class="Apple-tab-span" style="white-space:pre;">
        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre;">                </span>// the corba system may soon alloc a new output buffer,</div><div><span class="Apple-tab-span" style="white-space:pre;">                </span>// free the current one if it exists</div><div><span class="Apple-tab-span" style="white-space:pre;">                </span>CORBA::string_free((char *) _outBuf);</div><div>...</div><div><span class="Apple-tab-span" style="white-space:pre;">                </span>connVar -> getChildrenList ((char *)_inBuf, _inBufSize, reply, outBufSize);</div><div><span class="Apple-tab-span" style="white-space:pre;">        </span> _outBuf = reply;</div><div>...</div><div><span class="Apple-tab-span" style="white-space:pre;">        </span>}</div><div><br></div><div><br></div><div><b><span class="Apple-style-span" style="font-size:medium;">Server side summary:</span></b></div><div><br></div><div><b>Service_i.cpp</b></div><div><br></div><div>CORBA::Long
Service_i::getChildrenList (const char *req_data,</div><div> CORBA::Long req_data_len,</div><div> <b>CORBA::String_out response_data,</b></div><div> CORBA::Long &response_data_len)</div><div>{</div><div>...</div><div><span class="Apple-tab-span" style="white-space:pre;">        </span>CORBA::Long ret = serverImplGetChildrenList(req_data, req_data_len, <b>response_data</b>, response_data_len, resv );</div><div>...</div><div>}</div><div><br></div><div><b>ServerImpl.cpp</b></div><div><br></div><div>int
serverImplGetChildrenList( const char * request_data,</div><div> long request_data_len,</div><div><b> char * & response_data,<span class="Apple-style-span" style="white-space:pre;"> </span></b><b>// should this be CORBA::String_var & response_data, or is there more required?</b></div><div> long & response_data_len,</div><div> char* reserved)</div><div>{</div><div>...</div><div><span class="Apple-tab-span" style="white-space:pre;">        </span>// allocate memory for the response on the heap</div><div><span class="Apple-tab-span" style="white-space:pre;">        </span>response_data = new char [1024000];</div><div><br></div><div><span class="Apple-tab-span"
style="white-space:pre;">        </span>// populate the response buffer with data</div><div>...</div><div><span class="Apple-tab-span" style="white-space:pre;">        </span>return SUCCESS;</div><div>}</div><div><br></div><div><br></div></div><div><br></div><div><br></div><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt;"><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><div class="Section1">
</div>
</div></div><div style=""></div>
</div></div></div><div style=""></div>
</div></div></div><div style="position:fixed"></div>
</div></body></html>