LeakScope: Android Lifecycle & Memory Leak Violations
About this report: This issue was automatically generated by LeakScope, a static analysis tool for Android lifecycle violations and memory leaks built on the Soot framework. This is part of an ongoing academic research study targeting ICSE 2027. No immediate action is required — we would greatly appreciate your feedback on whether these findings are accurate.
Summary
LeakScope detected 5 potential issue(s) across 3 detector type(s):
| Severity |
Count |
| 🔴 High |
1 |
| 🟡 Medium |
1 |
| 🟢 Low (improvement opportunity) |
3 |
| Detector |
Count |
Severity |
Description |
StateHolderLeak |
1 |
🔴 High |
Static field holds UI/Context reference across configuration changes |
ServiceResourceManagementIssueDetector |
1 |
🟡 Medium |
Service may never stop — missing stopSelf() call |
ViewBindingOpportunity |
3 |
🟢 Low |
Manual findViewById() calls — ViewBinding migration opportunity |
Detailed Findings
🔴 StateHolderLeak
Static field holds UI/Context reference across configuration changes
Finding #1 — MainActivity
Potential State Holder Memory Leak Detected
Class: com.zcshou.gogogo.MainActivity
Issue: Scenario 2: Static field 'mBaiduMap' of type 'com.baidu.mapapi.map.BaiduMap' in Activity/Fragment is a custom object that may hold UI references. Static fields survive configuration changes.
Fix: Use ViewModel or SavedStateHandle to persist state across rotations.
🟡 ServiceResourceManagementIssueDetector
Service may never stop — missing stopSelf() call
Finding #2 — ServiceGo
⚠� Service may never stop. Consider calling stopSelf() when work is complete.
Class: com.zcshou.service.ServiceGo
Method: onStartCommand
🟢 ViewBindingOpportunity
Manual findViewById() calls — ViewBinding migration opportunity
Finding #3 — WelcomeActivity
View Binding Migration Opportunity
Class: com.zcshou.gogogo.WelcomeActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
• findViewById in checkAgreementAndPrivacy
• findViewById in showAgreementDialog
• findViewById in showAgreementDialog
• findViewById in showAgreementDialog
• findViewById in showPrivacyDialog
• findViewById in showPrivacyDialog
• findViewById in showPrivacyDialog
• findViewById in onCreate
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak
Finding #4 — HistoryActivity
View Binding Migration Opportunity
Class: com.zcshou.gogogo.HistoryActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
• findViewById in initRecordListView
• findViewById in initRecordListView
• findViewById in initRecordListView
• findViewById in initSearchView
• findViewById in lambda$initRecordListView$4$com-zcshou-gogogo-HistoryActivity
• findViewById in lambda$initRecordListView$5$com-zcshou-gogogo-HistoryActivity
• findViewById in lambda$initRecordListView$5$com-zcshou-gogogo-HistoryActivity
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak
Finding #5 — MainActivity
View Binding Migration Opportunity
Class: com.zcshou.gogogo.MainActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
• findViewById in initGoBtn
• findViewById in initMap
• findViewById in initMap
• findViewById in initMap
• findViewById in initMap
• findViewById in initMap
• findViewById in initMap
• findViewById in initMap
• findViewById in initMap
• findViewById in initMapButton
• findViewById in initMapButton
• findViewById in initMapButton
• findViewById in initMapButton
• findViewById in initMapButton
• findViewById in initNavigationView
• findViewById in initSearchView
• findViewById in initSearchView
• findViewById in initSearchView
• findViewById in initSearchView
• findViewById in initUserInfo
• findViewById in initUserInfo
• findViewById in showProtocolDialog
• findViewById in showProtocolDialog
• findViewById in showProtocolDialog
• findViewById i
… (truncated for brevity)
How to respond to this issue:
- If a finding is a true positive: consider applying the recommended fix and closing this issue.
- If a finding is a false positive: please leave a comment explaining why — your feedback directly improves our research.
- If you have questions: reply here or open a discussion.
This report was generated by LeakScope as part of the ICSE 2027 research artifact. Tool analyzes compiled APKs using Soot static analysis on GoGoGo.
LeakScope: Android Lifecycle & Memory Leak Violations
Summary
LeakScope detected 5 potential issue(s) across 3 detector type(s):
StateHolderLeakServiceResourceManagementIssueDetectorViewBindingOpportunityDetailed Findings
🔴
StateHolderLeakStatic field holds UI/Context reference across configuration changes
Finding #1 —
MainActivity🟡
ServiceResourceManagementIssueDetectorService may never stop — missing stopSelf() call
Finding #2 —
ServiceGo🟢
ViewBindingOpportunityManual findViewById() calls — ViewBinding migration opportunity
Finding #3 —
WelcomeActivityFinding #4 —
HistoryActivityFinding #5 —
MainActivityHow to respond to this issue:
This report was generated by LeakScope as part of the ICSE 2027 research artifact. Tool analyzes compiled APKs using Soot static analysis on GoGoGo.