[TUHS] [tuhs] The Unix shell: a 50-year view

Tomasz Rola rtomek at ceti.pl
Thu Jul 8 04:32:22 AEST 2021


On Tue, Jul 06, 2021 at 08:46:34PM -0400, Theodore Ts'o wrote:
> On Wed, Jul 07, 2021 at 01:17:00AM +0200, Tomasz Rola wrote:
> > 
[...]
> > https://www.emacswiki.org/emacs/EmacsApplicationFramework
[...]
> > 
> 
> Well, the old joke was that emacs stood for "eight megabytes and
> constantly swapping". 

Yeah, during my 486 days it was indeed doing stuff with disk. But I
was too happy to have this "workstation lookalike" running "Unix
lookalike" installed from dozens of floppies so I did not complained
about some minor problems.

> These days, sure, starting a fresh Emacs
> version 27 process has a SIZE of 364 megabytes with an RSS of 78
> megabytes.
> 
> OTOH, starting a fresh copy of Konsole (KDE's current terminal
> emulator) has a SIZE 1383 megabytes with an RSS of 114 megabytes, and
> the single Konsole process running all of my terminal windows has a
> SIZE of 2160 megabytes (or just a touch over 2GB) with an RSS of 189
> megabytes.

An excerpt from my ps:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND

xxxek      576  0.0  0.2 283392 34172 pts/122  SNl  Jun29   0:06 emacs

xxxek    23684  0.3  1.7 379624 211872 pts/21  SN   Jul03  22:06 emacs /ho

xxxon    12331 12.5 20.4 5898360 2519640 ?     TNsl Mar29 18278:11 firefox-esr

xxxon     3553  0.0  1.2 218028 150656 pts/67  TN   Jun30   0:24 dillo

xxxek    12588  0.0  0.0  38108   752 pts/183  T     2020   0:00 lynx -nocolor -force-html /ho

xxxek     6785  0.0  0.0 310580 10052 pts/22   Sl    2020  41:51 roxterm

xxxek     5321  0.0  0.0 102712  1456 tty2     S     2020   1:56 rxvt -bg Black

xxxek     5322  0.0  0.0  66784  1988 tty2     S     2020 165:48 xterm -bg

xxxek     5596  0.0  0.0  21608   536 pts/121  S+    2020   1:35 /usr/bin/screen


Emacs ver.23, firefox ver. "very old". I do not trust my browsers too
much, so when I go to sleep they go to STOP freeze. The second emacs
is editing my pathetic########glorious######## wiki with org-mode,
file length about 55 megabytes, with unicodes, so the rss is multiple
of file size. I have long ago replaced konsole with roxterm. As you
can see, it eats nowhere near a gigabyte. And it does not read a whole
disk when starting. It usually goes with three tabs opened, so maybe
in your case memsize would have been bigger. I make a lot of use with
virtual desktops offered by fvwm, and when I need terminal on one of
those desktops (I usually do), I open some rxvt variation; position,
resize and keep it there for further use.

As I have only 12gigs of ram and more than half goes to ramdisk
(always doing something there, including compiling huge piles of code
from the net), so I have to keep an eye on firefox. When it goes above
2.9g of rss I usually start to fret and kill unneeded tabs. I set it
up to use only two or three fonts and completely disregard
author-provided fonts. So far, so good. Ah, and I use noscript,
too. Yet despite of all those precautions, I have to kill -STOP it,
because the mere thought that it will keep eating 50-90% of cpu while
doing nothing, well, this drives me up the wall. Likewise, back in the
past, when I saw how *idle* program (firefox) constantly wrote *gigs*
of bytes to my disk, I simply went mad. Long story short, now it only
can write to temporary place in ramdisk. It still does not stop it
from opening multiple files on disk in /tmp, deleting them and keeping
opened/deleted forever, using up my precious ram. It sometimes closes
those files, but not very often.

I usually open new pages in dillo, w3m or lynx (or curl) and use
firefox when nothing else would do. Not perfect solution - dillo has
some memory problem, so I usually have many of them opened and slash
those who grow too much. Like, 300megs for dillo is enough. Read up
all the tabs in it and kill. And it seems I have (pidof lynx|wc -w)
170 lynx processes, all kill-stopped and awaiting my
attention. Craps. Chances are I did not stopped being mad. At least
Unix command line tools allow me to measure it.

> As a percentage of the 32 GB physical memory in my Desktop machine,
> I'm not too worried about the memory consumption of either the
> terminal windows or emacs, especially since the browser takes a lot
> more memory.  These days, I run my browser in a container to limit its
> physical memory usage to 12GB; systemd makes setting this up via a
> user unit file really easy.  :-)
> 
> 	      	      	      	    - Ted
> 
> # ~/.config/systemd/chrome.service
> [Unit]
> Description=Chrome Browser
> 
> [Service]
> ExecStart=/usr/bin/google-chrome
> KillMode=process
> MemoryAccounting=true
> MemoryMax=12G

Now I am happy that I do not use systemd. Now I want to find more time
and migrate to OpenBSD. I really do (I know there are some Linux
distros which evaded systemd - for a while, but I consider a whole
Linux land to be lost already, just a matter of time, and I foresee
that OpenBSD will fall as the very last, if ever). I will sleep less
and program more. I will rewrite all my old python2x scripts in r7rs
scheme. Not really so many. Fruits of hard work shall be sweet and
plentiful.

12g for a browser. I am not criticising you, but I could say a bit
about people who made programs and websites contributing to such
sizes. 

-- 
Regards,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature.      **
** As the answer, master did "rm -rif" on the programmer's home    **
** directory. And then the C programmer became enlightened...      **
**                                                                 **
** Tomasz Rola          mailto:tomasz_rola at bigfoot.com             **


More information about the TUHS mailing list