Unable to hibernate laptop with spotify open

This is an interesting issue, even since the last big update a while ago I was unable to hibernate my laptop. Trying to hibernate, either using oblogout or sudo systemctl hibernate always fails.

Running sudo journalctl -u systemd-hibernate.service shows the following:

jun 19 14:25:42 UD-Legion systemd[1]: Starting Hibernate...
jun 19 14:25:42 UD-Legion systemd-sleep[103584]: Suspending system...
jun 19 14:25:44 UD-Legion systemd-sleep[103584]: Failed to suspend system. System resumed again: Cannot allocate memory
jun 19 14:25:44 UD-Legion systemd[1]: systemd-hibernate.service: Main process exited, code=exited, status=1/FAILURE
jun 19 14:25:44 UD-Legion systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
jun 19 14:25:44 UD-Legion systemd[1]: Failed to start Hibernate.
jun 19 14:25:44 UD-Legion systemd[1]: systemd-hibernate.service: Consumed 1.767s CPU time.

However after shutting down Spotify, which I have customized using spicetify installed from the AUR, works as expected.
Naturally I don’t run out of memory because of Spotify, I have 8 Gb of RAM and an extra 8 Gb of swap, and after checking htop I have more than enough space to hibernate.

My system specs:

  • Processor: i5
  • GPU: Intel/Nvidia 1050Ti
  • Kernel: 5.4.124-1
  • Arch: x86_64
  • Branch: Stable
  • WM: i3
  • System is up to date
  • NVidia is running the display