
Niggle: the code (.txt) of the python interpreters is shared, but not the stack, the rss nor the heap. Starting a new process still requires reading the binary from disk to get the rss contents and initial heap size. Slow! Solaris tried to improve that a bit by getting that information from the in-memory copy of the file that contained the .txt segment, but I don't know if they succeeded. One of the Helios folks from 0xide would probably know. --dave On 2/3/25 11:43, Ron / BCLUG via talk wrote:
D. Hugh Redelmeier via talk wrote on 2025-02-02 20:30:
I think this is correct: basically most of the processes are Python interpreters plus the scripts they're running.
Python interpreters are surely shared. That's the way Linux works for compiled languages like C.
Think of it like this:
$ python prog1.py & $ python prog2.py &
There are now two python interpreters loaded in RAM.
That's what's going on here.
Similarly with compiled C programs:
$ ./prog1 & $ ./prog2 &
Those programs might be loading dynamic libraries, but they'd be loading them twice.
If byte-code isn't shared, this seems like a scandal.
It is indeed kind of scandalous.
If the space is actually being consumed by data, how could mailman be so profligate? Just a bunch of python scripts running.
Check it out on penguin, running mailman v2:
$ pgrep python | wc -l 8
Alternately (lines trimmed to avoid wrapping):
$ ps -ef | grep python /usr/bin/python /usr/lib/mailman/bin/mailmanctl -s -q start /usr/bin/python /var/lib/mailman/bin/qrunner --runner=ArchRunner /usr/bin/python /var/lib/mailman/bin/qrunner --runner=BounceRunner /usr/bin/python /var/lib/mailman/bin/qrunner --runner=CommandRunner /usr/bin/python /var/lib/mailman/bin/qrunner --runner=IncomingRunner /usr/bin/python /var/lib/mailman/bin/qrunner --runner=NewsRunner /usr/bin/python /var/lib/mailman/bin/qrunner --runner=OutgoingRunner /usr/bin/python /var/lib/mailman/bin/qrunner --runner=VirginRunner /usr/bin/python /var/lib/mailman/bin/qrunner --runner=RetryRunner
I can't imagine the kernel seeing all those python scripts running and de-duplicating RAM like some file systems will de-duplicate storage (ZFS) as that is expensive itself.
Corrections welcome. --- Post to this mailing list talk@gtalug.org Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk
-- David Collier-Brown, | Always do right. This will gratify System Programmer and Author | some people and astonish the rest davecb@spamcop.net | -- Mark Twain