Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LAPI memory leaks?

Status
Not open for further replies.

llprogrammer

Programmer
Mar 26, 2009
13
RU
Hi All,
I work on Livelink project and can't find the source of memory leaks in it. The project is COM dll that send documents to Livelink server, so there's method StoreDoc():
DocSender::StoreDoc()
{
LL_Initialize( LL_HEADER_VERSION );
...
LL_SessionAllocEx( &session, server, port, "", login, password, NULL);
...
/* Here we do some work and store document into LL server*/

if (session != NULL){
LL_SessionFree( session );
}
LL_Uninitialize();
}

In order to eliminate inessential details I had write this simple program:

LLSTATUS f(){
LL_Initialize( LL_HEADER_VERSION );
LL_SessionAllocEx( &session, server, port, "", login, password, NULL);
if (session != NULL){
LL_SessionFree( session );
}
LL_Uninitialize();
}

void g(){
for(int i=0;i<=1000; i++){
f();
}

int main(){
g();
}

and run it. During execution quantity of memory have risen
from 3Mb to 20Mb!

Any ideas would be greatly appreciated!

Thanks in advance,
Alexey.
 
I have no advice rather than a suggestion.Your LAPI code is in C++ or VB that is the reason why you have to explicitly free the session.I would repeat your simple test and write a few lines of code in java or C# and observe it as well.If you then find that that codebase also is leaking i would write to support at opentext dot com and ask for further advice.

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer and probably certfiable,Livelink ECM Champion 2008

 
appnair,
thank you for suggestion, but i have no time to write to support so i dicedided to implement quick-fix:

LLSTATUS f(){
LL_SessionAllocEx( &session, server, port, "", login, password, NULL);
if (session != NULL){
LL_SessionFree( session );
}
}

void g(){
LL_Initialize( LL_HEADER_VERSION );
for(int i=0;i<=1000; i++){
f();
}
LL_Uninitialize();
}

This seems to be OK.

Alexey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top