Re: Regarding loops and memory leak

Ilan Aelion <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Dimoco
Message-ID <[email protected]>
Hi Ken, all, 

I tried the test_octstr program but did not see a memory leak. On the other 
hand when I checked my leak with valgrind it also reported large allocations 
by octstr_grow. 

- Ilan


On Sunday 12 September 2004 17:53, "Ken A. Redergård" wrote:
> Hi,
>
> Read your posting in the [email protected] list and have a simliar
> problem myself.
>
> I'm also running SuSE 9.1 and experience a memoryleak which I described
> in this posting:
> http://www.kannel.org/mailman/private/devel/2004-August/020299.html
>
> As Stipe Tolj said it does not show up in valgrind, but the leak is
> present and increasing as long as the loop is beeing run.
>
> Could you try to run this piece of code and tell me if you also get a
> memoryleak ?
> It could be that the while(run) semantics in your example are equal to
> the one in the leaking example below.
>
> /* test_octstr.c */
>
> #include <unistd.h>
> #include "gwlib/gwlib.h"
>
> int main(void) {
>   Octstr *os;
>   int i;
>
>   gwlib_init();
>
>  while(1) {
>     os = octstr_format("sadfasdfasdfas");
>     octstr_append(os, octstr_imm("asdfasdfasdfasdf"));
>     octstr_destroy(os);
>     gwthread_sleep(1);
>   }
>
>   /* we never get here */
>   return 0;
> }
>
> With regards,
> Ken A. Redergård
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.