AnyMemo
AnyMemo copied to clipboard
org.liberty.android.fantastischmemo.downloader.dropbox.DropboxDBListActivity may leak
I found that org.liberty.android.fantastischmemo.downloader.dropbox.DropboxDBListActivity may leak if we rotate screen many times. As shown in the figure bellow, over 40 instances of org.liberty.android.fantastischmemo.downloader.dropbox.DropboxDBListActivity were found!
This might be caused by the fact that there were many AsynchroTasks waiting to be executed by the default SerialExecutor!
Maybe the "org.liberty.android.fantastischmemo.downloader.oauth.OauthAccessCodeRetrievalFragment$RequestTokenTask" should not be declared as an inner class.
At the same time, instances of "org.liberty.android.fantastischmemo.downloader.google.SpreadsheetListScreen" also leaked with, maybe, the same reason:
The .hprof file (zipped with WinRAR, please change ".txt" to ".rar") is attached: heap_2.txt
The async task should continue to execute until it is done. Once the async task is done, it should release the reference to the Activity. I still wonder why. Looks like RequestTokenTask is the key. I will investigate further. The Dropbox Activity is being re-written, so I will need to handle this correctly.
Similar situations happen to org.liberty.android.fantastischmemo.downloader.quizlet.QuizletSearchByTitleActivity