We (@yuchi1989 + @guitard0g) are researchers in Columbia University developing a static analysis tool to analyze memory leak bugs related to UI objects. Our tool identifies one bug in your source code (particularly the onCreate method of StatisticsActivity.java). Here is the code snippet.
Here we are storing an Activity in a static variable, which can lead to this Activity persisting beyond its lifecycle when the app is suspended or closed. Often you can save memory usage by setting this statisticsActivity variable to null in the onPause() or onDestroy() methods in the Activity.
Hi,
We (@yuchi1989 + @guitard0g) are researchers in Columbia University developing a static analysis tool to analyze memory leak bugs related to UI objects. Our tool identifies one bug in your source code (particularly the onCreate method of StatisticsActivity.java). Here is the code snippet.
https://github.com/SecUSo/privacy-friendly-memo-game/blob/87d0844f2db7ae79d2715825f00e44932aad7c98/app/src/main/java/org/secuso/privacyfriendlymemory/ui/navigation/StatisticsActivity.java#L60
Here we are storing an Activity in a static variable, which can lead to this Activity persisting beyond its lifecycle when the app is suspended or closed. Often you can save memory usage by setting this
statisticsActivity
variable tonull
in theonPause()
oronDestroy()
methods in the Activity.