I don’t know, if this is really related to shared memory, as your system seems to have enough.
Could you run the code via:
$ gdb --args python my_script.py
...
Reading symbols from python...done.
(gdb) run
...
(gdb) backtrace
...

and post the backtrace here?