Memory leak found...

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Memory leak found...

Christian Magnusson

I found a memory leak in ServerDir() which leaked about 128 bytes for
every single directory listing on a remote server.... I have to blame
everything on me since it was some test-code I made which wasn't removed
when I added pn->path_busless to simplify the usage of all Server*()
function.

I will create new WRT54G firmware with this updated cvs-version as soon
as possible.

--
Christian Magnusson <[hidden email]>



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

RE: Memory leak found...

Alfille, Paul H.,M.D.
Great news. Thanks.

What do you use to track the process' memory usage?

Paul

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]]On Behalf Of
Christian Magnusson
Sent: Wednesday, June 15, 2005 7:46 AM
To: owfs-developers
Subject: [Owfs-developers] Memory leak found...



I found a memory leak in ServerDir() which leaked about 128 bytes for
every single directory listing on a remote server.... I have to blame
everything on me since it was some test-code I made which wasn't removed
when I added pn->path_busless to simplify the usage of all Server*()
function.

I will create new WRT54G firmware with this updated cvs-version as soon
as possible.

--
Christian Magnusson <[hidden email]>



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

RE: Memory leak found...

Christian Magnusson

In this case it was just by reading the source... I noticed
/proc/xxx/status increased memory for each 'ls', so I just
stumbled into the leakage.

valgrind could be used to report all leaks after application
has quit. It gives a pretty nice report where all unfreed
bytes were created. It was some time ago I used it now, but
it didn't like the mutexes in owfs (locking/unlocking in
from different processes) unless VALGRIND was defined in
ow_net.c

/Christian


On Wed, 2005-06-15 at 16:28, Alfille, Paul H.,M.D. wrote:

> Great news. Thanks.
>
> What do you use to track the process' memory usage?
>
> Paul
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]]On Behalf Of
> Christian Magnusson
> Sent: Wednesday, June 15, 2005 7:46 AM
> To: owfs-developers
> Subject: [Owfs-developers] Memory leak found...
>
>
>
> I found a memory leak in ServerDir() which leaked about 128 bytes for
> every single directory listing on a remote server.... I have to blame
> everything on me since it was some test-code I made which wasn't removed
> when I added pn->path_busless to simplify the usage of all Server*()
> function.
>
> I will create new WRT54G firmware with this updated cvs-version as soon
> as possible.



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

RE: Memory leak found...

Christian Magnusson
In reply to this post by Alfille, Paul H.,M.D.

I have checked in some more minor changes to avoid valgrind warnings.
If you want to try it, define VALGRIND in ow.h and try a command-line
like this:

valgrind -v --log-file=valgrind.log --trace-children=yes --track-fds=yes
--error-limit=no --tool=memcheck --leak-check=yes --show-reachable=yes
--trace-children=yes /opt/owfs/bin/owserver --foreground -
P /var/run/owserver.pid -p 5006 -d /dev/ttyS0

/Christian



On Wed, 2005-06-15 at 10:28 -0400, Alfille, Paul H.,M.D. wrote:

> Great news. Thanks.
>
> What do you use to track the process' memory usage?
>
> Paul
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]]On Behalf Of
> Christian Magnusson
> Sent: Wednesday, June 15, 2005 7:46 AM
> To: owfs-developers
> Subject: [Owfs-developers] Memory leak found...
>
>
>
> I found a memory leak in ServerDir() which leaked about 128 bytes for
> every single directory listing on a remote server.... I have to blame
> everything on me since it was some test-code I made which wasn't removed
> when I added pn->path_busless to simplify the usage of all Server*()
> function.
>
> I will create new WRT54G firmware with this updated cvs-version as soon
> as possible.
>
--
Christian Magnusson <[hidden email]>



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers