
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.