Spotify has been terminated by the Linux kernel because the system is low on memor

Hello guys, I’m currently new on this OS community and I’m facing this issue:
“Spotify has been terminated by the Linux kernel because the system is low on memory. Consider closing unused applications or browser tabs.”

Tried to use “zram” to avoid this situation but it keeps happening. Usually it happens when 2 clients of “tibia” are open with other applications at the same time. PC freezes and then one client and spotify closes. Is there any solution for this or this might be due to my pc memory/shit spec ?
System info:

System:
  Kernel: 6.12.28-1-lts arch: x86_64 bits: 64 compiler: gcc v: 15.1.1
  Desktop: KDE Plasma v: 6.3.5 tk: Qt v: N/A wm: kwin_wayland dm: SDDM
    Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Laptop System: SAMSUNG product: 550XDA v: P23CFB
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: SAMSUNG model: NP550XDA-KH2BR
    v: SGLB443A02-C01-G001-S0001+10.0.22621 serial: <superuser required>
    part-nu: SCAI-A5A5-A5A5-TGL3-PCFB UEFI: American Megatrends LLC.
    v: P23CFB.053.241029.HQ date: 10/29/2024
Battery:
  ID-1: BAT1 charge: 37.3 Wh (100.0%) condition: 37.3/43.1 Wh (86.6%)
    volts: 12.5 min: 11.4 model: SAMSUNG Electronics SR Real Battery
    serial: <filter> status: not charging
CPU:
  Info: quad core model: 11th Gen Intel Core i5-1135G7 bits: 64 type: MT MCP
    arch: Tiger Lake rev: 1 cache: L1: 320 KiB L2: 5 MiB L3: 8 MiB
  Speed (MHz): avg: 1106 min/max: 400/4200 cores: 1: 1106 2: 1106 3: 1106
    4: 1106 5: 1106 6: 1106 7: 1106 8: 1106 bogomips: 38720
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] vendor: Samsung Co
    driver: i915 v: kernel arch: Xe ports: active: HDMI-A-2,eDP-1
    empty: DP-1,HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:9a49
  Device-2: IMC Networks VGA camera driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 3-7:3 chip-ID: 13d3:5a24
  Display: wayland server: X.org v: 1.21.1.16 with: Xwayland v: 24.1.6
    compositor: kwin_wayland driver: X: loaded: modesetting
    alternate: fbdev,intel,vesa dri: iris gpu: i915 d-rect: 3840x2160
    display-ID: 0
  Monitor-1: HDMI-A-2 pos: bottom-r model: AOC 22B1WG5 res: 1920x1080 hz: 75
    dpi: 102 diag: 545mm (21.5")
  Monitor-2: eDP-1 pos: primary,top-left model: BOE Display 0x0812
    res: 1920x1080 hz: 60 dpi: 142 diag: 395mm (15.5")
  API: EGL v: 1.5 platforms: device: 0 drv: iris device: 1 drv: swrast gbm:
    drv: iris surfaceless: drv: iris wayland: drv: iris x11: drv: iris
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 25.0.5-arch1.1
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel Iris Xe Graphics (TGL
    GT2) device-ID: 8086:9a49 display-ID: :1.0
  API: Vulkan Message: No Vulkan data available.
  Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
    de: kscreen-console,kscreen-doctor wl: wayland-info
    x11: xdpyinfo, xprop, xrandr
Audio:
  Device-1: Intel Tiger Lake-LP Smart Sound Audio vendor: Samsung Co
    driver: snd_hda_intel v: kernel bus-ID: 00:1f.3 chip-ID: 8086:a0c8
  API: ALSA v: k6.12.28-1-lts status: kernel-api
  Server-1: PipeWire v: 1.4.2 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
Network:
  Device-1: Intel Wi-Fi 6 AX201 driver: iwlwifi v: kernel bus-ID: 00:14.3
    chip-ID: 8086:a0f0
  IF: wlan0 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: Samsung Co driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1
    port: 3000 bus-ID: 02:00.0 chip-ID: 10ec:8168
  IF: enp2s0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) driver: btusb
    v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 bus-ID: 3-10:4
    chip-ID: 8087:0aaa
  Report: btmgmt ID: hci0 rfk-id: 0 state: down bt-service: disabled
    rfk-block: hardware: no software: no address: N/A
Drives:
  Local Storage: total: 685.61 GiB used: 17.43 GiB (2.5%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLQ256HAJD-000
    size: 238.47 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> temp: 14.8 C
  ID-2: /dev/sda vendor: Kingston model: SA400S37480G size: 447.13 GiB
    speed: 6.0 Gb/s serial: <filter>
Partition:
  ID-1: / size: 437.07 GiB used: 17.22 GiB (3.9%) fs: ext4 dev: /dev/sda2
Swap:
  ID-1: swap-1 type: zram size: 3.74 GiB used: 1.7 GiB (45.3%) priority: 100
    dev: /dev/zram0
Sensors:
  Src: /sys System Temperatures: cpu: 47.0 C mobo: N/A
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 8 GiB available: 7.48 GiB used: 6.53 GiB (87.2%)
  Processes: 250 Power: uptime: 11h 36m wakeups: 0 Init: systemd v: 257
    default: graphical
  Packages: pm: pacman pkgs: 995 Compilers: gcc: 15.1.1 Shell: Bash
    v: 5.2.37 running-in: konsole inxi: 3.3.38

TYIA guys.

Maby there is a Memory leak in Spotify?
I don’t use it that often so I haven’t noticed.

Could be, I only noticed this happening on this two applications only.

Make real swap, probably easiest to do a swapfile. That’ll give you some breathing room, though your pc may get slower and slower if/as memory leaks.

Which client are you using for spotify ? The official proprietary client or a different one ? Furthermore, how intensive are those tibia clients ? Is there are a specific reason that you’re running two of them ?

There are various alternatives to the proprietary spotify client which are based on librespot. That API allows for a pretty lightweight client, such as ncspot which is a terminal client with only basic playback features. But requires a premium account, If I’m not mistaken.

I “downloaded” it via “yay -S spotify”.
I’m using two clients only when need to share some item between accs (btw this “server” /Otserver has an Linux client, I don’t know how optimized it is tbh)

Based on his systems specs, zram does make sense.

@phomur are you aware of these optimizations for the zram ?

Your stuff is pretty small.

I dont know how you configured zram but you might want to set it to 1x or 2x so that you have more ‘memory’ space.

For example if you use zram-generator then /etc/systemd/zram-generator.conf has the options ex;

[...]
zram-size = ram * 2
[...]

Would set zram (swap) to be double the size of your available physical memory.
Yes - this is acceptable so long as the compression-algorithm gives at least a 2:1 compression ratio. This should be surpassed by just about any option, but assuredly something like zstd.


The above deals with the apparently small size of memory and swap.
But it is still possible that the reason you are running out is because of some sort of run away process.
So - after configuring zram/swap for more space still pay attention to something like System Monitor to observe any possible problems.

Hey, I did this and tried to “stress” the max the memory to see if it happens again and it didn’t.
This answer and @1093i3511’s answer worked for this situation. TYVM guys <3

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.