Mailing List Archive

Memory leak or stored info
I've done 8000 test connection to conserver. One connection is a
connect and a disconnect. I'm using expect and the console client to do
this. I'm noticing a small memory leak. After 8000 connection 2.5megs
are lost. Is there info that is being stored or could this be a real
memory leak? Version 7.2.5

Chris
Re: Memory leak or stored info [ In reply to ]
well, there is definitely a leak popping up on my linux box, but only
under certain situations. without --with-pam or --with-openssl, i
don't see a leak. if i compile using --with-pam, i get a very small
leak. if i compile using --with-openssl, i get a very noticable leak
(a few kb per connection). these leaks happen when i just do a connect
and immidiately disconnect (passwords have to be used to trigger the
--with-pam leak). part of me is wondering if the --with-pam leak is
really the pam libraries themselves and not conserver, but i'm
currently under the impression it's conserver until i can prove
otherwise.

so, i'm not sure what configuration you're using, but if you have
--with-openssl or --with-pam, i'm probably seeing what you're seeing.
if your situation is different, let me know.

i'm going to focus on looking at the memory leaks and see if i can't
track some of this down. if anyone else happens to notice something,
let me know.

Bryan

On Mon, Feb 10, 2003 at 01:27:19PM -0500, cfowler wrote:
> I've done 8000 test connection to conserver. One connection is a
> connect and a disconnect. I'm using expect and the console client to do
> this. I'm noticing a small memory leak. After 8000 connection 2.5megs
> are lost. Is there info that is being stored or could this be a real
> memory leak? Version 7.2.5
>
> Chris
Re: Memory leak or stored info [ In reply to ]
[. On Thursday, February 13, 2003 at 19:13:44 (-0800), Bryan Stansell wrote: ]
> Subject: Re: Memory leak or stored info
>
> i'm going to focus on looking at the memory leaks and see if i can't
> track some of this down. if anyone else happens to notice something,
> let me know.

On NetBSD I'm still seeing major memory leaks, albeit still with my
hacks for using "chat" to login to a terminal server.

$ console -V
console: conserver.com version 7.2.0
console: initial master server `console'
console: default escape sequence `^Ec'
console: on port 2000 (referenced as `2000')
console: built with `./configure --verbose --sysconfdir=/etc --with-libwrap --with-port=2000 --with-base=2001'

$ ps -laxc | fgrep conserver
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
0 238 1 20 2 0 160 168 select Is ?? 0:18.63 conserver
0 14047 238 0 2 0 220 176 select I ?? 0:04.58 conserver

$ ps -laxc | fgrep conserver
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
0 238 1 0 2 0 160 168 select Ss ?? 0:20.01 conserver
0 14047 238 0 2 0 320 176 select S ?? 0:13.84 conserver


Note the growth from 220KB to 320KB.

That's after running:

i=1
while [ $i -lt 100 ] ; do
(echo AT^M; sleep 2) | console -f callerid;
((i++))
done

Note that "callerid" is an RS-232 connected Caller-ID box which responds
to AT\r with "OK" just like a modem. There's never any invocation of my
"chat" code on this particular conserver instance (callerid is also the
only defined console connetion it services).

Also note that during this time there was another client connected, thus
the need for the '-f'. (I have Netsaint connecting to both ports every
five minutes or so, but without doing anything and just checking that
the TCP connect works, and there's no leak from that.)

Some day soon I may be able to try merging up to the latest release and
re-compiling with ElectricFence and/or vmalloc and/or dmalloc. Vmalloc
in particular would allow me to see what kind of memory is leaking and
where it might have been allocated.

--
Greg A. Woods

+1 416 218-0098; <g.a.woods@ieee.org>; <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>