Regarding loops and memory leak

"Ken A. Redergård" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
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.