OOM, process is killed

What can I do to mitigate this? Is it a version issue? I have the newest version of pytorch and python.

Is it an issue with
-the code (refrain from saving all variables, making the mini-batch smaller?)
-the operating system (I use ubuntu 20.04)

The specific error I get when running dmesg in the terminal is “Out of memory: Killed process”


It is very hard to say with no information about what you were doing.
Is it actually your python process that was eating up all the memory or something else?
If it was the python process, what were you doing when it happened?