Re: [uCsimm] Memory leak caused by fopen

From: Tom Walsh (
Date: Tue Jun 05 2001 - 17:14:56 EDT

Ian Leonard wrote:
> I have a program with a memory leak. Every 4 or 5 iterations, memory
> usage goes up by 4096 bytes. Does anybody know why this should be?
> I see from the uClib source that fopen allocates a buffer for the
> data when it opens. I thought that this should be done on the first
> i/o operation. It looks like fclose deallocates memory (although it
> obviously doesn't) and setvbuf () doesn't help either.

Assuming that you are using the older libc and not the newer uClibc, it
is a known problem with libc. There were some patches to correct for
this, about a year ago. Otherwise, if this is uClibc that is giving
this problem, then tell the guys over on the uClibc mailing list, I am
sure they would want to know! see:



Tom Walsh - WN3L - Embedded Systems Consultant,
"Windows? No thanks, I have work to do..."
This message resent by the list server

This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:43 EST