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

Memory leak #15

Open
JasonLG1979 opened this issue Feb 14, 2015 · 11 comments
Open

Memory leak #15

JasonLG1979 opened this issue Feb 14, 2015 · 11 comments

Comments

@JasonLG1979
Copy link
Contributor

qAndora spawns new threads for each new song and RAM usage gets crazy after a while. After listening for a few hours it was 60+ threads strong and RAM usage was over 100MB. It's got to be in the VLCplayer or VLC.py it's self. I wrote a tkinter UI and it exhibits the same behavior. So I know it's not Pyside/Qt. I'm definitely not an expert on the VLC bindings but from the looks of things a new player is created every time the song changes if so it seems that the old instance is not properly destroyed?
tkdora

@JeffHoogland
Copy link
Owner

That is in fact what is happening. VLC python docs are here -> https://www.olivieraubert.net/vlc/python-ctypes/doc/

I don't see a delete function though for the player class.

@JasonLG1979
Copy link
Contributor Author

I've been browsing those for a couple days. There's a release function but as soon as you hit it, it locks up the player. there's got to be a way to only have one instance running and just add url's to it's playlist.

@JeffHoogland
Copy link
Owner

Yea - I was never able to get the API to add songs to an existing player,

@JasonLG1979
Copy link
Contributor Author

We'll figure it out. It's got to be in there somewhere.

@JasonLG1979
Copy link
Contributor Author

Maybe something along these lines? https://forum.videolan.org/viewtopic.php?t=90233

@JeffHoogland
Copy link
Owner

Does that support appending more files later?

@JasonLG1979
Copy link
Contributor Author

Switching back to the gstreamer backend and adding a bus to detect the eos signal until I can figure out the vlc bindings. Everything I've tried so far has awesomely failed...

@JasonLG1979
Copy link
Contributor Author

Found out how to kill the old player. It was in fact "release."

It basically works like this. I attached another callback to the end reached event that invokes "release" then "nextSong" from the mainloop. Now it never goes over 5 threads. Next up is to try to tame the RAM usage. It seems to go up a megabyte or 2 everytime the song changes. Maybe it's not clearing the song out of memory? When I get that figured out I'll do a merge request.

@JeffHoogland
Copy link
Owner

Sounds good. I'm going to be fairly quiet the next couple of weeks as quarter where I teach is coming to an end. Will be reading/reviewing anything you post.

@JasonLG1979
Copy link
Contributor Author

That's cool gotta pay those bills,lol!!! It'll give me a chance to do some tweaking.

@JasonLG1979
Copy link
Contributor Author

The memory leak is in the list created in addSongs and in nextSong. Even if everything is disabled and all you do is retrieve a playlist and cycle through the song index without even actually loading anything, RAM usage increases by pretty much exactly the amount as the data(album art, mp4 audio file, etc) that would have been loaded if everything weren't disabled. And it's never garbage collected. You would expect that the list would be a reference to the objects not the actual objects themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants