[Date Prev][Date Next] [Chronological] [Thread] [Top]

Heap memory allocation problem



Title: Heap memory allocation problem

Hi all,
I notice a problem of memory allocation, running the C program allegated.

This program simply make a loop of search operation:
for(j=1; j<10000; j++)
{
        printf("%d\n",j);      
        Search(HOST,PORT,USER,PSW,BASE,2,ATTRIB,FILTRO);       
}
where the Search function is very similar to the standard function explained in the LDAP C SDK examples.

I run the program on a Sun machine with SunOS 5.7 and I look the memory status using
/usr/proc/bin/pmap  nnnn    where nnnn is the PID.

I see that the heap memory always  increase, but I call all the free memory function present in C SDK:

ldap_value_free(valori) ... ldap_memfree( attributi ) ... bee_free(ber) ... ldap_msgfree(res);

in the correct way (I think).


Massimo

<<Testldap5.c>>

Attachment: Testldap5.c
Description: Binary data