Let’s say you are making a long running network call and updating the UI.
By the time network call completes its work ,
if the activity / fragment get destroyed, we will find the Observer subscription is still alive, and it tries to update already destroyed activity.
In this case it can throw a memory leak. So using the Disposables, the un-subscription can be when the activity is destroyed.
Can maintain list of subscriptions in a pool and can dispose them all at once . Usually we call compositeDisposable.clear() in onDestroy() method, but you can call anywhere in the code.