Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to Playlist Dialog memory leak #817

Closed
1 task done
TheFlyingRat opened this issue Oct 17, 2023 · 14 comments
Closed
1 task done

Add to Playlist Dialog memory leak #817

TheFlyingRat opened this issue Oct 17, 2023 · 14 comments
Labels
bug Something isn't working

Comments

@TheFlyingRat
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Even with no queue, Spotube will chew through an additional 20mb of ram per second until the computers memory fills up.

It's not downloading anything(?), since no disk usage is being used as showing in task manager

Expected Behavior

If it's trying to preload my music library (or album art etc...), it should stop at about 15% of memory usage since my library contains about 12,000 unique songs totaling all my playlists.
It definitely should not be using this much ram.
I personally have 32GB of ram, and it'll fill in about 15 minutes until my computer is non functional and requires a reboot since my PC blue screens.

Steps to reproduce

  1. Open spotube
  2. Open a playlist, it'll fill the computer to 100% of RAM within a few minutes depending on your ram amount and speed.

Operating System

Windows x64

Spotube version

3.2.0

Installation source

GitHub Releases (Binary)

Additional information

No response

@TheFlyingRat TheFlyingRat added the bug Something isn't working label Oct 17, 2023
@KRTirtho
Copy link
Owner

Not sure what's happening in your case. Are you sure you're on the latest version?
Because some older versions had memory leaks, but that have been fixed.
in my case it's lower than ever before
image

@TheFlyingRat
Copy link
Author

Are you sure you're on the latest version?

I am indeed on the latest version 3.2.0...

Here it is using above 2GB of memory after being open for about 5 minutes:

spotube memory

@KRTirtho
Copy link
Owner

KRTirtho commented Oct 18, 2023

I'm unable to reproduce this issue

Can you describe the exact steps? Including login

@TheFlyingRat
Copy link
Author

  1. Install the latest version of Spotube from github releases.
  2. Open spotube and proceed with login
  3. Login by copying the values of required cookies from open.spotify.com into spotube
  4. Let spotube load and cache the names of my playlists and main spotify page
  5. Open a playlist, more songs = larger memory usage(?)
  6. Wait for spotube to either preload a bunch of songs, or album art or whatever that is going on in the background
  7. Observe memory usage go up in task manager between 1mb/sec to 150mb/s.

It appears to get worse with larger playlists, after further examination.
It might be better in this version compared to 3.1 since it hasn't entirely filled my memory yet, but still uses a considerably high amount.
Does spotube save downloaded album arts to disk? If they're loading into memory for on-the-fly usage, this might be fly it eats so much memory since having 10000 songs in one playlist and having it download each, even at 1mb each is 10gb.
If you're unable to reproduce it, it might be a once off. I've let spotube run for a few hours and it hasn't exceeded 4gb of ram. After a while, it garbage collects and ram drops by as much as 70% which IS expected. Maybe the first time I ran it, the garbage collector failed or something went wrong? Either way, implementing something to prevent ram usage going above 15-20% of total memory may help future malfunctions?
I'm completely unsure myself to be honest

@TheFlyingRat
Copy link
Author

Same symptoms as #659 but in latest version.

@Vatroki
Copy link

Vatroki commented Oct 19, 2023

I'm also having the same issues as #659 in the 3.2.0 version. CPU gets to 94% usage over time, and i don't even have that many playlists or songs, around a 100

@TheFlyingRat
Copy link
Author

spotube ram usage

Here's a good example. This time, I was searching for a song. Found it, and clicked add to playlist. Then it froze, and spiked up to 22gb of ram while using 300mb/s of my disk for no apparent reason?

Issue still happens in latest version of Spotube.

@KRTirtho
Copy link
Owner

KRTirtho commented Nov 7, 2023

Just as same as #820. The dialog is causing this issue

@KRTirtho KRTirtho changed the title Spotube happily chews through 20mb of ram per second until memory fills up entirely Add to Playlist Dialog memory leak Nov 7, 2023
@TheFlyingRat
Copy link
Author

Yes. Same as that too. It seems like there are memory leaks everywhere within the application. Add to Playlist works sometimes, same with loading a playlist. It seems the whole GUI has a chance of becoming frozen

@KRTirtho
Copy link
Owner

KRTirtho commented Nov 8, 2023

It seems like there are memory leaks everywhere within the application. Add to Playlist works sometimes, same with loading a playlist. It seems the whole GUI has a chance of becoming frozen

Just because one part has an accidental memory leak doesn't mean the entire app has memory leaks everywhere. While loading a playlist, if the playlist is huge it takes time to load, thus shows the placeholders which indicate it's loading something. This doesn't mean it has memory leaks. First learn what a memory leak is

@FallCheetah7373
Copy link

FallCheetah7373 commented Nov 11, 2023

Can confirm windows 11, I crashed my laptop 4 times today was wondering whether it was a software side issue and it was, after 4 attempts I was able to open taskmanager to see 99% memory usage I am wondering if this is an issue on Linux? if not I can just stop being lazy and switch over to my linux partition.

@FallCheetah7373
Copy link

Can confirm windows 11, I crashed my laptop 4 times today was wondering whether it was a software side issue and it was, after 4 attempts I was able to open taskmanager to see 99% memory usage I am wondering if this is an issue on Linux? if not I can just stop being lazy and switch over to my linux partition.

just crashed my linux partition as well lol...is there a temporary fix to this?

@hackerb9
Copy link

It seems like there are memory leaks everywhere within the application.

Hey, I know it's frustrating, but please try to not make needlessly negative generalizations. The developer is doing this out of the goodness of their heart and we want to encourage them.

To that end, @TheFlyingRat, since you're running a desktop version, could you try the Flutter Debugger and see where your memory is going? https://docs.flutter.dev/tools/devtools/memory

Thanks!

@TheFlyingRat
Copy link
Author

Hi, I understand and I apologize. I didn't mean for my comment to be taken the wrong way.

What I meant is that usually I'll run into some sort of error where my memory spikes up when using Spotube and all of its features. It's indeed frustrating and I do thank you Kingkor for your efforts in Spotube.

@hackerb9 I will indeed try that. That should help iron out some things. Thank you for your suggestion :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Deployed
Development

No branches or pull requests

5 participants