EdenYouTube
EdenYouTube copied to clipboard
Memory leak
YouTube library is known for memory leaks. Your sample has them as well. Steps to reproduce:
- Tap on 'Hosting the YoutubeFragment in an Activity'
- Wait for the Activity to load
- Go back
- Repeat
https://code.google.com/p/gdata-issues/issues/detail?id=6738 http://www.reddit.com/r/androiddev/comments/2klmeg/youtube_fragment_huge_memory_leak/
Unless you have suggestions on how to prevent them all I can do is star the issue on Google code and put a warning in the example, thanks for pointing it out though
I was struggling with this issue as well. The only solution that really works is to use YouTube player in a separate process. Then, after closing the Activity with YouTube player, you have to kill it using Unix signal 9. Android will free the memory of that process as a part of low-level clean up.