Memory and cache
How songs move between memory, the disk cache and pinned downloads.
Songs are held in memory while they play. Only recently played songs are cached on disk, up to a limit set in Settings (500 MB by default). When the cache is over the limit, audio_cache removes the least recently played songs first.
Right-click downloads are pinned for offline use. Pinned songs are never removed and don't count towards the limit.
Mixes longer than 20 minutes use the 96 kbps stream. Mixes over 80 MB are only stored if you download them.
The cache stores an index on disk. When the index loads, entries with missing files are dropped. Loudness results and waveforms have separate caches.
An earlier version kept every song's candidate versions in memory during Spotify migration, which could reach hundreds of MB on a big playlist. The current version no longer holds them.