Skip to content

Does using multiple processes for a python app use memory sharing? #1243

Answered by ac000
bunny-therapist asked this question in Support
Discussion options

You must be logged in to vote

Thanks for the link to the video. That made me dig a little deeper.

My answer here may change slightly what you take away from my original answer.

Now gc.freeze is some Python API and obviously when we do the fork(2) we are still in C, but that is all moot anyway...

The prototype processes only load the required Unit language module, e.g for python $(modulesdir}/python.unit.so, which in turn loads the required libraries for that language. e.g the python prototype process loads these (the PHP language module loads a lot more things...)

$ pmap -p PID
...
00007f0c7d800000    496K r---- /usr/lib64/libpython3.12.so.1.0
00007f0c7d87c000   2180K r-x-- /usr/lib64/libpython3.12.so.1.0
00007f0c7da9…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@bunny-therapist
Comment options

@ac000
Comment options

@bunny-therapist
Comment options

@ac000
Comment options

Answer selected by bunny-therapist
@bunny-therapist
Comment options

@ac000
Comment options

@bunny-therapist
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants