pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.47k stars 87 forks source link

Completely freeze when memory reaches 100% #1459

Open donielix opened 3 years ago

donielix commented 3 years ago

Distribution:

NAME="Pop!_OS" VERSION="20.10" ID=pop ID_LIKE="ubuntu debian" PRETTY_NAME="Pop!_OS 20.10" VERSION_ID="20.10" VERSION_CODENAME=groovy UBUNTU_CODENAME=groovy

(information provided by neofetch)

Kernel: 5.8.0-7630-generic DE: GNOME 3.38.2 WM: Mutter CPU: Intel i7-6700HQ (8) @ 3.500GHz GPU: NVIDIA GeForce GTX 950M GPU: Intel HD Graphics 530 Memory: 15847MiB (and 16 GB of swap)

(I'm dual booting with Windows 10)

Issue/Bug Description:

Pop Os becomes totally unresponsive when RAM memory exceeds its limit. After that, pressing any key has no effect, nor moving mouse. I can only hold off button to fully shutdown the computer, losing all the work done.

Steps to reproduce:

For example, in my case running the following python code leads to crash:

import numpy as np, numba as nb

@nb.njit
def fail(arr):
    out = np.empty(len(arr))
    for i,v in enumerate(arr):
        out[i] = np.random.normal(v)
    return out

fail(np.linspace(1,100,int(1e9)))

But this is not the only way to reproduce the issue. Sometimes, in other situations like playing youtube videos or spotify music also get system crashing.

Expected behavior:

Another Distros like Ubuntu, or Manjaro, when running out of memory, just kill the conflictive task before totally crashing, and release its memory. Only Pop Os freezes when running above code.

Other Notes:

ids1024 commented 3 years ago

This is a common issue with desktop Linux systems. Or at least it has been in the past.

Another Distros like Ubuntu, or Manjaro, when running out of memory, just kill the conflictive task before totally crashing, and release its memory. Only Pop Os freezes when running above code.

I wonder if Ubuntu is currently enabling something like EarlyOOM...

donielix commented 3 years ago

This is a common issue with desktop Linux systems. Or at least it has been in the past.

Another Distros like Ubuntu, or Manjaro, when running out of memory, just kill the conflictive task before totally crashing, and release its memory. Only Pop Os freezes when running above code.

I wonder if Ubuntu is currently enabling something like EarlyOOM...

And there is no way to solve it? Because I think it's a major problem that can cause a significant loss of data, and in other operating systems it doesn't happen

ids1024 commented 3 years ago

A program called EarlyOOM is meant to help with this, as is a new project called systemd-oomd. I believe Fedora was recently planning to enable one of these by default. But I don't think most distros currently do.

Not sure how Ubuntu or Manjaro might differ. Perhaps they set some sysctl settings that change the behavior here.