0

I'm running Ubuntu Server 20.04 fully up-to-date with a Raspberry Pi 4, 4GB of RAM (may be relevant or not, but system is running with an SSD through an USB3.0 port) as a low-power PC capable of running some Docker images. It runs xfce4 displaying a Magic Mirror, and it recollects some data through the GPIO ports (which takes only a few mA): power supply is an original 3A power adapter.

The problem I'm having is that today it lost the ethernet connection but the rpi itself kept on running just fine... until I plugged in a keyboard at which point it just kernel panicked or so. No logging at that point available to know what happened there.

When I checked out the journal, the following caught my attention: https://pastebin.com/0VNDSUyL

At the time, memory usage was about 90% according to the latest data available (I run Telegraf and log everything to an Influxdb instance running [both with Docker] on the same machine).

The process that was killed was Java, but I don't know which Docker image it was because the runtime isn't even installed on the host.

  • Is this an indicator that I am running low on RAM? What can I do to avoid this problem in the future?
  • Why did the OOM-killer kicked in while I still had about 10% of RAM left? Is this tweakable?
  • Why did it kill my ethernet connection? Did it left the system in an unstable condition?
  • Can it be something hardware related that is creating this issue?

I don't know where to look further atm, so any help here would be very much appreciated! If you need more details, just ask :)

EDIT1:

I have no swap enabled on this system:

ubuntu@unifi:~ $ free -h
              total        used        free      shared  buff/cache   available
Mem:          3.7Gi       2.7Gi       190Mi       203Mi       826Mi       886Mi
Swap:            0B          0B          0B
ubuntu@unifi:~ $ grep -i swap /etc/fstab 
ubuntu@unifi:~ $ 
2
  • 1
    Do you have a /swapfile on this computer? It looks like not. Memory is full and no place to swap. Boom. Edit your question and show me free -h and grep -i swap /etc/fstab.
    – heynnema
    Aug 24, 2020 at 0:15
  • Hi @heynnema thanks for answering! I have no swap configured so that might just be it :) Totally forgot about it!
    – unreal4u
    Aug 24, 2020 at 7:03

1 Answer 1

0

Let's create the missing /swapfile...

Note: Incorrect use of the dd command can cause data loss. Suggest copy/paste.

sudo swapoff -a           # turn off swap
sudo rm -i /swapfile      # remove old /swapfile

sudo dd if=/dev/zero of=/swapfile bs=1M count=4096

sudo chmod 600 /swapfile  # set proper file protections
sudo mkswap /swapfile     # init /swapfile
sudo swapon /swapfile     # turn on swap
free -h                   # confirm 4G RAM and 4G swap

Confirm this line in /etc/fstab... and confirm no other “swap” lines...

/swapfile    none    swap    sw      0   0

reboot                    # reboot and verify operation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.