Memory leak? Having resource issues dockerized / snapcast

Recently I noticed that I started having a lot of UI issues w/ Iris after playing a bunch of album all day. I hadn’t looked under the hood in a while but I’ve been monitoring my setup and it seems like there’s a memory leak somewhere? I understand Python is memory managed but this seems… bad.

My setup is I am running mopidy/iris inside a Docker container hosted on a Proxmox VM. I’m orchestrating everything with Portainer & docker-compose yamls.

Linux a4361e76b1b6 6.2.16-12-pve #1 SMP PREEMPT_DYNAMIC PMX 6.2.16-12 (2023-09-04T13:21Z) x86_64 GNU/Linux
Python 3.11.2
gst-launch-1.0 version 1.22.0
GStreamer 1.22.0
https://tracker.debian.org/pkg/gstreamer1.0
Mopidy 3.4.1
[core]
cache_dir = $XDG_CACHE_DIR/mopidy
config_dir = $XDG_CONFIG_DIR/mopidy
data_dir = /usr/share/mopidy
max_tracklist_length = 10000
restore_state = true

[logging]
verbosity = 0
format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n  %(message)s
color = false
config_file = 

[audio]
mixer = software
mixer_volume = 
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! tcpclientsink host=coltrane.chief.home
buffer_time = 

[proxy]
scheme = 
hostname = 
port = 
username = 
password = 

[api_explorer]
enabled = true

[bandcamp]
enabled = true
discover_pages = 1
collection_items = 50
discover_genres = 
  All
  Electronic
  Rock
  Metal
  Alternative
  Hip-Hop/Rap
  Experimental
  Punk
  Folk
  Pop
  Ambient
  Soundtrack
  World
  Jazz
  Acoustic
  Funk
  R&B/Soul
  Devotional
  Classical
  Reggae
  Podcasts
  Country
  Spoken Word
  Comedy
  Blues
  Kids
  Audiobooks
  Latin
discover_tags = 
  indie rock
  lofi
  turntablism
  breaks
  ambient
image_sizes = 
  10
  5
  2
identity = xxx
[iris]
enabled = true
country = US
locale = en_US
verify_certificates = true
snapcast_enabled = true
snapcast_host = mingus.chief.home
snapcast_port = 1780
snapcast_ssl = false
snapcast_stream = Mopidy
spotify_authorization_url = https://jamesbarnsley.co.nz/iris/auth_spotify.php
lastfm_authorization_url = https://jamesbarnsley.co.nz/iris/auth_lastfm.php
genius_authorization_url = https://jamesbarnsley.co.nz/iris/auth_genius.php
data_dir = $XDG_DATA_DIR/iris

[mixcloud]
enabled = true
users = 
tags = 
search_max = 20
refresh_period = 600
ignore_exclusive = true

[spotify]
enabled = false  ; Extension disabled by user config.

[file]
enabled = true
media_dirs = 
  $XDG_MUSIC_DIR|Music
  ~/|Home
excluded_file_extensions = 
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .pdf
  .png
  .txt
  .zip
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
zeroconf = Mopidy on $hostname
allowed_origins = 
csrf_protection = false
default_app = iris

[m3u]
enabled = true
base_dir = 
default_encoding = latin-1
default_extension = .m3u8
playlists_dir = 

[softwaremixer]
enabled = true

[stream]
enabled = true
protocols = 
  http
  https
  mms
  rtmp
  rtmps
  rtsp
metadata_blacklist = 
timeout = 5000

[local]
enabled = true
max_search_results = 100
media_dir = /mnt/Music
scan_timeout = 5000
scan_flush_threshold = 100
scan_follow_symlinks = false
included_file_extensions = 
excluded_file_extensions = 
  .cue
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .pdf
  .png
  .txt
  .zip
directories = 
  Albums                  local:directory?type=album
  Artists                 local:directory?type=artist
  Composers               local:directory?type=artist&role=composer
  Genres                  local:directory?type=genre
  Performers              local:directory?type=artist&role=performer
  Release Years           local:directory?type=date&format=%25Y
  Tracks                  local:directory?type=track
  Today's Updates\t  local:directory?max-age=86400
  Last Week's Updates     local:directory?max-age=604800
  Last Month's Updates    local:directory?max-age=2592000
timeout = 10
use_artist_sortname = false
album_art_files = 
  *.jpg
  *.jpeg
  *.png

[podcast]
enabled = true
browse_root = http://pod.chief.home/rss
browse_order = desc
lookup_order = asc
cache_size = 64
cache_ttl = 86400
timeout = 10

[scrobbler]
enabled = false  ; Extension disabled due to config errors.
username =   ; Must be set.
password =   ; Must be set.

[somafm]
enabled = true
encoding = mp3
quality = fast
dj_as_artist = true

[soundcloud]
enabled = true
explore_songs = 25
auth_token = ********

[tunein]
enabled = true
timeout = 5000
filter =

I appreciate the time taken to post the question but we need far more detailed info if we are to look into this because it’s incredibly time consuming. I think every case of this in the past 10 years has turned out to be a misunderstanding of how Linux manages memory. The first step is to strip everything back to the absolute minimum, containers and process monitors are are added complexity (and sources of memory issues themselves). Then reproduce with the simplest test case possible and provide the debug log for that. I appreciate that’s a lot of effort but that’s the reality of what is needed.

Edit: The very first step would be to swap your audio output for fakesink.

1 Like

@chiefy You should remove your bandcamp token before posting you config, no?

1 Like

Sorry, I know it’s difficult to debug this kind of issue was just hoping for pointers more than a solution. I will try the fakesink tip, thanks.

d’oh, i quickly scanned the config and thought it automagically obfuscated it, thanks @Matthias_Meulien

Feel free to raise that as a bug to mopidy-bandcamp, if it’s a secret they should treat it as such to avoid this.

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