Closed christinna9031 closed 2 years ago
Hi @christinna9031, sorry I didn't get back to this earlier. Did you manage to fix it?
It's unlikely that the problem is in this library, as it barely makes a http request to Spotify's API.
One thing that can cause it is if you are calling getMyCurrentPlaybackState()
before a previous call to that function returns, either successfully or with an error. Otherwise there can be a long stack of pending requests piling up.
The memory leak is still happening, I had to reduce the getMyCurrentPlaybackState() API calls to the bare minimum. I'm also looking into polling the API on server side and extending websocket to the client instead.
I call getMyCurrentPlaybackState() every second to detect whenever user changes the track. I tried using both setInterval and setTimeout (with clearTimeout as well), but it seems to be leaking memory and crashes the whole page after 5-6h of running nonstop in a browser. Memory consumption just goes up indefinitely until it crashes. Any idea how to fix that?