
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 & If my memory serves me correctly all the code is shared between the
On 2025-02-03 11:43, Ron / BCLUG via talk wrote: processes Its just the data which is private to each process. Now in the case of an interpreter, the xxx.py programs are just data from the OS point of view so that is duplicated.
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.
Once again I am fairly sure only the data is duplicated and the code is shared and write protected.
If byte-code isn't shared, this seems like a scandal.
It is indeed kind of scandalous.
It should be possible for the byte-code to be shared among processes but that would likely add a layer of complexity that the developers would not be comfortable with.
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
-- Alvin Starr || land: (647)478-6285 Netvel Inc. || home: (905)513-7688 alvin@netvel.net ||