This is not always a memory problem. In my case, subprocess.Popen used, which threw an error of 137, which looks like signalKILL, and the reason is definitely not in memory usage, because at run time it almost did not use 1% of memory usage. This seems to be a resolution issue after further investigation. I just moved the scripts from /home/ubuntu to the root directory.
source share