On Sat, 1 Sep 2012 01:34:11 -0300 Gustavo Sverzut Barbieri
> On Friday, August 31, 2012, Carsten Haitzler wrote:
> > On Fri, 31 Aug 2012 19:40:29 +0200 maderios
> > <maderios@...:;>> said:
> > > On 08/31/2012 12:09 AM, Carsten Haitzler (The Rasterman) wrote:
> > >
> > > >> Is it normal Terminology takes 78 Mb memory ?
> > > >> xfce4-terminal takes 15 Mb
> > > >
> > > > terminology uses about 4mb. i suggest you examine how you measure it
> > or give
> > > > more detail.
> > > >
> > >
> > > Release testing (debian wheezy) 64-bit
> > > Kernel Linux 3.4.9
> > > Hardware
> > > memory 7,8 GiB
> > > Processor Intel® Core™ i7-2600 CPU @ 3.40GHz × 8
> > >
> > >
> > > I launched gnome-system-monitor then Terminology
> > > terminology resident memory= 50 MiB
> > >
> > > Terminology Controls then I restart e
> > > terminology resident memory= 70 MiB
> > > memory= 38,0 MiB
> > > shared memory= 41 MiB
> > > virtual memory=383 MiB
> > generally actually used memory is resident MINUS shared memory. or that's
> > closer to reality. the BESt measurement you can do is a system one. the
> > problem
> > is that this will include all system usage, so memory used for pixmaps and
> > compositing and the window manager also are measured. so let me do some
> > measurements here.
> > 1. nvidia drivers on this box
> > 2. e17 with compositing (gl engine).
> > 3. ubuntu 12.04 base
> > run 1 xterm instance. difference in system memory usage (everything
> > xterm+wm+x
> > +etc.):
> > 4576kb
> > run 2nd xterm instance. difference in system mem usage:
> > 3072kb
> > to measure the "system" mem usage for 1 window the size of xterm, i ran one
> > remotely displaying locally so all costs are wm+x11:
> > 496kb
> > (that's pretty much about right - the xterm client window is 402x242
> > pixels.
> > att 23 pixels of titlebar and 4 of bottom bar - the pixels alone for the
> > pixmap
> > are 433kb, so about 64kb of "overhead" here and there per window).
> > to measure 1 gnome-terminal usage (difference in system mem):
> > 8916kb
> > 2nd gnome-terminal:
> > 3556kb
> > so first instance of terminology:
> > 7192kb
> > 2nd instance:
> > 7516kb
> > ok - so a bit higher, but close. all of these have about 500k of
> > wm/compositor/x11 overhead for compositing. xterm uses less memory for the
> > 2nd
> > instance BECAUSE it has to use libraries like xt which e and efl dont use,
> > so
> > these need "loading" once. same for the executable binary itself. once
> > loaded
> > they are shared, thus the 2nd xterm adds less overhead. gnome-terminal is
> > special as it doesn't even start a 2nd process. it re-uses the first and
> > just
> > opens a new window from it, but same applies to gtk etc. libs being now
> > needed
> > like xterm with xt.
> > lets try urxvt:
> > 5700
> > snd instance:
> > 5472
> > so here's the catch. terminology has at least 1 largish rgba image in its
> > local
> > memory (the gradient shine) that will consume about 350-400k on its own. it
> > also keeps all fonts client-side (unlike gnome-terminal and xterm).
> > so my measurements put 1 terminology instance at about 6800kb (avg 7300kb
> > minus about 500kb for system overhead). if you use xterm you basically pay
> > about 2500kb per term. gnome-terminal costs you about 3000kb per terminal.
> > urxvt costs about 5000kb. this is with default setup of terminology (and
> > xterm,
> > urxvt and gnome-terminal configured to use the same font or font size).
> > so let's do some work in the term. all these numbers so far are for fresh
> > terminals at 80x24 default.
> > let's have our workload be:
> > find /usr/lib
> > that should now consume some memory in backscroll etc. - all terms set to
> > 2000
> > lines backscroll history.
> > terminology: 1016kb
> > gnome-terminal: 460kb
> > xterm: 2816kb
> > urxvt: 1380kb
> > catch: gnome-terminal puts its backscroll on disk not in memory. this has
> > been
> > raised as a security hold in gnome-terminal and dismissed by its authors
> > as not
> > one. so it'll be consuming disk not memory here. but it consumes ram
> > anyway,
> > just less.
> > so... these numbers seem about right to me. base memory usage per app.
> > system
> > (compositor/pixmap/x11/wm), etc. terminology does a lot more inside its
> > own
> > process than the others in terms of rendering, memory buffers, image and
> > font
> > data etc. terminology will need 8 bytes per char in the backscroll which is
> > pretty much what it uses (well 1250kb - but my bet is it has freed some
> > memory
> > from init/startup and now recycled it for backscroll buffers - libc does
> > this
> > as a normal part of operation). gnome-terminal is trying to stuff
> > backscroll on
> > disk so this doesnt impact "used memory" (it does impact disk cache usage
> > whcih
> > i didn't measure here). urxvt backscroll usage makes complete sense. xterm
> > is
> > higher - it may be allocating more per backscroll char - eg 16bytes, which
> > would be overkill, but that's its decision.
> > so after you use the terminal for a bit, we have some backscroll too, our
> > total
> > usage is more like (rough nummbers):
> > terminology: 7800kb
> > xterm: 5300kb
> > gnome-terminal: 3500kb* (5500kb)
> > urxvt: 6400kb
> > * (scrollback is on disk so to be fair add 1-3mb depending on mem storage
> > format, so lets' say 2mb).
> > so.. if you measure.. do this:
> > free
> > run thing to measure
> > free
> > free will output numbers like:
> > total used free shared buffers cached
> > Mem: 8160736 695744 7464992 0 61196 268792
> > -/+ buffers/cache: 365756 7794980
> > Swap: 0 0 0
> > what you want is the "used -/+ buffers/cache" eg 365756.
> > now subtract the first number from the 2nd (you ran free twice). that's
> > your
> > overall system memory "expansion" to handle the task you now have run.
> > e.g.:
> > free
> > xterm &
> > free
> > as such terminology will use the memory it needs to get the job done. if
> > you
> > start playing videos in the bg.. well - it'll use more memory. same with
> > any
> > image data etc.
> This measurement is also bad as its impacting the whole system and easy to
> get wrong. If some crontab runs, or a browser is left running it will be
> completely bogus. Also the "find" command will cache dentries on first run.
> I know you are not doing mistakes, but a casual user that tries this may do.
> I'd recommend using smem/smaps tool, or at least memprof. But yes, it
> wouldn't measure xserver fonts or gnome terminal disk backlog.
i was just trying to kill the biggest mis-measurement which is seeing top or ps
or this case gnome stuff and reading out res/virt which is pretty far from
real. measuring total system impact is the easiest/closest to real.. if u can
keep the system stable. as you mention a cronjob or browser running will screw
the results. that's why i only try run the minimum needed to get the
measurement. :) i dont stop cron but i am pretty sure its not running something
during this time as i have an idea of the cron daily/weekly stuff that is set
up already (nothing much is set to hourly). but yes - it is something to note
and ensure when measuring. saying "gnome uses more mem than e" is aonly really
measurable this way tho and it can be used for other things :)
> Btw, I don't think gnome terminal is doing xserver fonts, are u sure? How
> about scrolling? Xserver move region?
it's using xft which means glyph pixmaps are held server-side. surre - font
geometry etc. is client-side.
> Btw2: mild shoul have less images by default, would make comparison more
> fair (still not equal since cursor, link and bell are there)
> > > Greetings
> > >
> > > --
> > > Maderios
> > >
> > --
> > ------------- Codito, ergo sum - "I code, therefore I am" --------------
> > ------------------------------------------------------------------------------
> > Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and
> > threat landscape has changed and how IT managers can respond. Discussions
> > will include endpoint security, mobile security and the latest in malware
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> > _______________________________________________
> > enlightenment-users mailing list
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-users
> Gustavo Sverzut Barbieri
> http://profusion.mobi embedded systems
> MSN: barbieri@...
> Skype: gsbarbieri
> Mobile: +55 (19) 9225-2202
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> enlightenment-users mailing list
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler) raster@...