[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ncurses: tgetent leaks nearly 10 KB of memory every time it is calle
From: |
Thomas Dickey |
Subject: |
Re: ncurses: tgetent leaks nearly 10 KB of memory every time it is called |
Date: |
Thu, 15 Jun 2006 19:43:22 -0400 (EDT) |
On Thu, 15 Jun 2006, Matt wrote:
GNU screen calls tgetent twice every time a user reattaches to a
screen session. I don't know why it does that, but due to the
memory leak in ncurses version 5.2-20020615, which is what ships
with FreeBSD as the standard curses/terminfo library, GNU screen
leaks 20 KB per session reattachment.
ok. So it's annoying, but not really hundreds of times (usually)
Many users on my system start a screen session and run processes
inside it for months or years, so these leaks add up quick. In the
past six months, my screen session has grown from 6 MB to 83 MB
(I tend to detach and reattach several times a day). My system ran
out of swap space a while back primarily due to this leak.
oh - I would do that on dayjob stuff, but my home machines get rebooted
according to whatever I'm working on.
So, since it's such a pain to upgrade ncurses on FreeBSD (they have
FreeBSD-specific hacks that I don't want to dig into), I'm hacking
a simple tgetent cache into my copy of GNU screen, since those
tgetent calls are just getting the same answer every time. I suspect
it will be at least a year before the FreeBSD folks make a new
release that incorporates ncurses 5.5; until then this hack will
get me by.
I tried installing the FreeBSD port of ncurses 5.5 and linking GNU
screen with that, but it doesn't work right -- it needs the
FreeBSD-specific hacks that have been made to the ncurses build
that the base system uses. It sure would be nice if those hacks
I pointed out to someone working on the ncurses port recently that most
(if not all) of it can be done simply by using ncurses' configure script
options
--enable-termcap \
--disable-database \
--enable-getcap
That was enough for the port, which I see here is the same as the base
system:
http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/lib/libncurses/termcap.c?rev=1.2.2.2&content-type=text/plain
weren't necessary, so I could just drop in the new version of ncurses
and enjoy. Maybe the hacks are for some kind of BSD backward
compatibility? Backward being the key word there. :)
not really compatibility - it's just politics (let's not go there)
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net