I'm try to update my school project with android architecture components. In these days I'm researching about ViewModel component in architecture components. I read lots of articles.
I know using viewmodel is used to provide data to the UI and survive configuration changes. But my question is this will be a cause of memory leak?. As an example If the reference is not cleared before the Activity’s lifecycle completes, it will be a memory leak. Most of the time Context will cause to the memory leak, because of Contexts contain many references to large amounts of memory.
If viewmodel will be the cause of the memory leak how to avoid it?
Thanks in advance.
References :
https://developer.android.com/topic/libraries/architecture/viewmodel