AW: AW: [uCsimm] General memory problem

From: Epping, Jörg (j.epping@benning.de)
Date: Tue Dec 12 2000 - 02:10:05 EST


Hi Zach,

I changed the opendir/closedir-structure members from pointers to static
arrays, removed the malloc/free parts in the opendir/closedir functions,
renamed them in my_opendir, my_closedir - that's all.
In your case try to change the bufstart pointer in stdio.h into an array of
BUFSIZ and remove the malloc/free parts in stdio.c.
But if you don't need fopen/fprintf etc... then read the mail from Claudio
Duffini - use open, write etc..., I think that would be better!

Joerg

> -----Ursprüngliche Nachricht-----
> Von: Zach Shelby [SMTP:zach.shelby@vtt.fi]
> Gesendet am: Montag, 11. Dezember 2000 15:04
> An: Epping, Jörg
> Betreff: Re: AW: [uCsimm] General memory problem
>
> Joerg,
>
> I narrowed down the problem to:
>
> fd = fopen("/var/weather.html", "w");
> fclose(fd);
> fd = fopen("/var/weather.wml", "w");
> fclose(fd);
> fd = fopen("/var/weather.xml", "w");
> fclose(fd);
>
> These leak 1kb each time called. What kind of things did you have to
> free in the opendir closedir functions to eliminate your leak? I do
> find alot of malloc calls in stdio2.c, but not sure which is causing
> it.
>
> - Zach
>
> Monday, December 11, 2000, 9:10:07 AM, you scribbled:
> EJ> I had the same problem with a daemon I developed. I found out that the
> EJ> functions I used (opendir, closedir) allocated memory, which was not
> freed
> EJ> (by closedir) after use. I took the sources from the libc
> EJ> (http://www.uclinux.org/pub/uClinux/libraries/) and then I rewrote the
> EJ> functions with static memory allocation.
> EJ> Maybe this will help you.
>
> EJ> Joerg Epping
>
> >> -----Ursprüngliche Nachricht-----
> >> Von: Zach Shelby [SMTP:zach.shelby@vtt.fi]
> >> Gesendet am: Freitag, 8. Dezember 2000 12:20
> >> An: 'ucsimm@uClinux.com'
> >> Betreff: [uCsimm] General memory problem
> >>
> >> Actually, I'm having memory leak problems as well. I haven't noticed
> >> it with the httpd (not using BOA...), but with one daemon I developed.
> >>
> >> Basically it eats 1000B per loop for the program. It is reading data
> >> from the serial port, parsing it with sscanf, then printing it to an
> >> .HTML file using lots of fprintf. stringcpy is used as well. This
> >> doesn't happen on my other 386 embedded linux machine (same code).
> >> Buffers are permanent, not allocated/deallocated.
> >>
> >> Any ideas?
> >>
> >> - Zach Shelby
> >>
> >> Friday, December 08, 2000, 10:30:45 AM, you scribbled:
> >> EJ> Hi !
> >>
> >> EJ> I'm using BOA (0.92q) with my uCsimm. Unfortunately I noticed that
> the
> >> EJ> server memory usage increases with every http-access.
> >> EJ> Is this a problem due to the MMU thing ?
> >> EJ> Has anyone noticed the same problem or maybe bugfixes for the
> problem
> >> ?
> >> EJ> Or is my configuration faulty ?
> >>
> >> EJ> TIA
> >>
> >> EJ> Joerg Epping
> >>
> >> EJ> This message resent by the ucsimm@uclinux.com list server
> >> http://www.uClinux.com/
> >>
> >> ----------------------------------------------------------------------
> >> Zach Shelby - Researcher Zach.Shelby@vtt.fi
> >> VTT Elektronics Phone +358 8 551 2164 (Office)
> >> Kaitoväylä 1, PL 1100 Fax +358 8 551 2320
> >> 90571 Oulu, Finland Mobile +358 40 7796297
> >> ----------------------------------------------------------------------
> >> http://paula.oulu.fi/~zdshelby
> >> Home: Yliopistokatu 14-707 90570 Oulu, Finland
> >>
> >>
> >> This message resent by the ucsimm@uclinux.com list server
> >> http://www.uClinux.com/
> EJ> This message resent by the ucsimm@uclinux.com list server
> http://www.uClinux.com/
>
>
>
> ----------------------------------------------------------------------
> Zach Shelby - Researcher Zach.Shelby@vtt.fi
> VTT Elektronics Phone +358 8 551 2164 (Office)
> Kaitoväylä 1, PL 1100 Fax +358 8 551 2320
> 90571 Oulu, Finland Mobile +358 40 7796297
> ----------------------------------------------------------------------
> http://paula.oulu.fi/~zdshelby
> Home: Yliopistokatu 14-707 90570 Oulu, Finland
>
>
> This message resent by the ucsimm@uclinux.com list server
> http://www.uClinux.com/
This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



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