| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Benjamin Scherrey | Date: | April 15 1999 7:48am |
| Subject: | Re: Memory leaking like a sieve in mysql client api. | ||
| View as plain text | |||
Seperately free'ing the MYSQL structure, as you suggested, does indeed
eliminate the memory leak. Unfortunately the manual never mentions the use of
free for a structure the library allocates. In fact, in the documentation of
mysql_init(), mysql_close() is described as the mechanism to free up this
memory. Only thing worse than no documentation is wrong documentation! :-(
Still it's weird that test1() never returns. Must be an infinite loop cause it
just sits there eating lots of cpu cycles. Of course, now that we know
mysql_close() isn't the answer to freeing memory I think I can work around this
potential occurance.
thanx & later,
Ben Scherrey
Mike Machado wrote:
> you should try calling free(mysql) at the end of each connection and see if
> that works.
>
> Benjamin Scherrey wrote:
>
> > I'm getting some unusual behavior out of the mysql client apis. Try the
> > following:
> >
> > // test1 results in your code never returning.
> > void test1( void )
> > {
> > MYSQL* mysql = mysql_init( NULL );
> >
> > mysql.close( mysql );
> > };
| Thread | ||
|---|---|---|
| • Memory leaking like a sieve in mysql client api. | Benjamin Scherrey | 15 Apr |
| • Re: Memory leaking like a sieve in mysql client api. | Benjamin Scherrey | 15 Apr |
| • Re: Memory leaking like a sieve in mysql client api. | Benjamin Scherrey | 15 Apr |
| • Re: Memory leaking like a sieve in mysql client api. | Benjamin Scherrey | 15 Apr |
| • Re: Memory leaking like a sieve in mysql client api. | Benjamin Scherrey | 15 Apr |
| • Re: Memory leaking like a sieve in mysql client api. | Michael Widenius | 15 Apr |
| • Memory leaking like a sieve in mysql client api. | Michael Widenius | 15 Apr |
| • Re: Memory leaking like a sieve in mysql client api. | Benjamin Scherrey | 15 Apr |
| • Re: Memory leaking like a sieve in mysql client api. | Michael Widenius | 16 Apr |
| • Re: Memory leaking like a sieve in mysql client api. | . | 16 Apr |
| • Re: Memory leaking like a sieve in mysql client api. | Michael Widenius | 17 Apr |
| • Re: Memory leaking like a sieve in mysql client api. | Fred Lindberg | 15 Apr |
| • Re: Memory leaking like a sieve in mysql client api. | Fred Lindberg | 15 Apr |
