EdenYouTube icon indicating copy to clipboard operation
EdenYouTube copied to clipboard

Memory leak

Open mkorniluk opened this issue 9 years ago • 2 comments

YouTube library is known for memory leaks. Your sample has them as well. Steps to reproduce:

  1. Tap on 'Hosting the YoutubeFragment in an Activity'
  2. Wait for the Activity to load
  3. Go back
  4. 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/

mkorniluk avatar Jun 25 '15 09:06 mkorniluk

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

ScottCooper92 avatar Jun 25 '15 09:06 ScottCooper92

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.

mkorniluk avatar Jun 25 '15 10:06 mkorniluk