Bug 76710

Summary: Huge memory footprint and huge memory leaks
Product: [Retired] Red Hat Linux Reporter: jfm2
Component: XftAssignee: Owen Taylor <otaylor>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: hp, nalin
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-11-19 09:12:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jfm2 2002-10-25 09:09:23 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.0.1) Gecko/20020830

Description of problem:
In one of my boxes (installed as works station) gnome terminal eats one of more
meg of memory (DRS ie not sharable) each time I do a ps axv on it.  If I create
a tab it eats some 6 more megs of meory and oes not realease it if I destroy it.
 And that on a base who is already huge for a mere terminal emulator (18 megs of
DRS).
<p>
I have another box (installed with hthe "everything" option) where
gnome-terminal uses 17 megs of DRS when started but memory footprint remains the
same.
<p>
The first box is using 16 bit color depth and the second 24 bit color 
depth


Version-Release number of selected component (if applicable):


How reproducible:
Sometimes

Steps to Reproduce:
1.On the "right" box memory leaks are 100% reproducible
2.On every box the unordinate memory footprint is 100% reproducible
3.
	

Additional info:

Comment 1 Havoc Pennington 2002-10-25 15:12:34 UTC
This is caused by a memory leak in Xft on X servers without the "render"
extension. It will work fine on X servers that have render.

Comment 2 jfm2 2002-10-28 19:50:08 UTC
Right.  But even in the box where gnome-terminal works it still eats something 
like 20 megs of memory.  And I don't use anything fancy like transparent 
backgrounds.
<p>
20 megs for a mere terminal emulator is a bug don't you think?

Comment 3 Havoc Pennington 2002-10-28 20:20:51 UTC
It depends on your setup. My gnome-terminal processes have something like 5392K 
used of which 3492K is shared. But I have only one terminal window per 
gnome-terminal process because I use --disable-factory.

Each terminal tab or window will add the scrollback buffer size to your footprint.
Note that all terminal windows are in the same process by default.
Check your scrollback buffer size in prefs.

Comment 4 jfm2 2002-11-03 18:37:29 UTC
I was using the _default_ parms like shipped by Redhat and with only the initial
tab.   IMHO if a mere terminal emulator eats nearly twenty megs with default
parms then it is a bug either in the program or in the fact those parms are
deafult.  Also I have problems envisionning what additional functionality a mere
terminal emulator could provide me whose value is worth 15 additional megs
(respactive to --nofactory) of memory use.  I know memory is cheap nowadays but
my 128M box is not worth to be upgraded and I will have to cope with it for an
additional year. :-)

Comment 5 Havoc Pennington 2002-11-03 19:00:03 UTC
Any defaults can use unlimited RAM, it has to do with how many windows/tabs you
open. How many do you have open when you see that much memory usage?

The primary factors in mem usage will be number of windows, and scrollback
buffer size. The default scrollback size is IMO reasonable. Number of
windows/tabs, we have no control over.

Comment 6 jfm2 2002-11-03 20:24:09 UTC
No tab or window but the implicit one.  It is on a fresh gome-terminal from a
fresh session from a freshly rebooted machine (ie there are no old terminals
hanging around who could confuse me).

Comment 7 Havoc Pennington 2002-11-03 21:02:35 UTC
My terminal isn't close to 20M in that situation, there's something weird going on.

Comment 8 jfm2 2002-11-03 21:24:19 UTC
Perhaps it is because I made an "everything" installation.   Thus I probable I
still have fonts for exotic languages and perhaps gnome-terminal has loaded them
all.  Of course it should not load unneeded fonts 

BTW IMHO anaconda should be smarter about the "everything" installation:  some
people like myself could want all the software but that does not mean we want
man pages in finnish and chinese fonts: it should install only the docs and
fonts required for the languages selected by the user.

Returning to our subject perhaps it is related to color depth (24bpp) or the NV
driver used by my NVidia card (I use the vanilla one shipped by RedHat).

Since I have ADSL I can send you any core file/strace/ltrace output you require

Comment 9 jfm2 2002-11-19 09:11:19 UTC
I have found that the output of ps is misleading.  Not only it does not properly
account for shared memory but sometimes I have found that total memory used by
system was X mags (with zero pages in swap used) while a _single_ program had a
DRS far superior to X.  Looks like all of shared libraries are mapped into DRS
even when using only a liitle part of them (I thougt they were mapped into the
text segment).
<p>
That means apparent memory consumption of gnome-terminal (in normal case not
when hitting the memory leaks on lack of RENDER extension) is not as high as it
looks.
I think we can close this bug. 


Comment 10 Havoc Pennington 2002-11-20 19:32:36 UTC
"top" and "gnome-system-monitor" give more heuristic memory usage output, 
that may be more in line with what one expects.

Closing then, thanks.