[LeakScope] 11 Android lifecycle/memory violations detected
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Tranquilla
- Ambito
- mobile-dev
Direzione di ricerca
Inizia esaminando le classi e i metodi elencati, inclusi NotePreviewFragment, NoteEditFragment, AboutFragmentLicenseTab, BrandingUtil e le Activities interessate, per verificare ogni riferimento segnalato a Lifecycle, State-Holder e Worker-Thread. Il lavoro è completato quando tutti gli 11 Findings sono stati valutati e i leaks confermati sono stati risolti oppure i False Positives sono stati documentati in un commento dell’Issue; non sono indicati file sorgente o test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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 11 potential issue(s) across 3 detector type(s):
| Severity | Count |
|---|---|
| 🔴 High | 11 |
| 🟡 Medium | 0 |
| 🟢 Low (improvement opportunity) | 0 |
| Detector | Count | Severity | Description |
|---|---|---|---|
FragmentViewFieldRetentionLeak |
3 | 🔴 High | Fragment stores View references in instance fields not cleared in onDestroyView() |
StateHolderLeak |
1 | 🔴 High | Static field holds UI/Context reference across configuration changes |
ThreadedUIReference |
7 | 🔴 High | Worker thread captures Activity/Fragment/View reference |
Detailed Findings
🔴 FragmentViewFieldRetentionLeak
Fragment stores View references in instance fields not cleared in onDestroyView()
Finding #1 — NotePreviewFragment
Fragment View Field Retention Leak Detected
Class: it.niedermann.owncloud.notes.edit.NotePreviewFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : it.niedermann.owncloud.notes.databinding.FragmentNotePreviewBinding (assigned in onCreateView)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
Finding #2 — NoteEditFragment
Fragment View Field Retention Leak Detected
Class: it.niedermann.owncloud.notes.edit.NoteEditFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : it.niedermann.owncloud.notes.databinding.FragmentNoteEditBinding (assigned in onCreateView)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
Finding #3 — AboutFragmentLicenseTab
Fragment View Field Retention Leak Detected
Class: it.niedermann.owncloud.notes.about.AboutFragmentLicenseTab
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• binding : it.niedermann.owncloud.notes.databinding.FragmentAboutLicenseTabBinding (assigned in onCreateView)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
🔴 StateHolderLeak
Static field holds UI/Context reference across configuration changes
Finding #4 — BrandingUtil
Potential State Holder Memory Leak Detected
Class: it.niedermann.owncloud.notes.branding.BrandingUtil
Issue: Scenario 1: Long-lived class field 'dialog' of type 'com.nextcloud.android.common.ui.theme.utils.DialogViewThemeUtils' holds UI reference. Prevents UI garbage collection.
Fix: Avoid storing UI in long-lived components. Use WeakReference.
🔴 ThreadedUIReference
Worker thread captures Activity/Fragment/View reference
Finding #5 — ManageAccountsActivity
Scenario 1: Worker thread holds UI object reference
Class: it.niedermann.owncloud.notes.manageaccounts.ManageAccountsActivity
Method: void lambda$changeAccountSetting$6(it.niedermann.owncloud.notes.databinding.DialogEditSettingBinding,it.niedermann.owncloud.notes.persistence.NotesRepository,it.niedermann.owncloud.notes.persistence.entity.Account,java.util.function.Function,int,java.util.function.Function,android.content.DialogInterface,int)
Statement: $r7 = new it.niedermann.owncloud.notes.manageaccounts.ManageAccountsActivity$$ExternalSyntheticLambda3
Captured UI objects:
- r0 : it.niedermann.owncloud.notes.manageaccounts.ManageAccountsActivity
Risk: UI object will be kept in memory until thread completes
Fix: Use WeakReference or avoid passing UI objects to worker threads
Finding #6 — NotePreviewFragment\n// (Full source code omitted for brevity)\n"
{
"text_input": "package it.niedermann.owncloud.notes.edit;\n\n// Class: it.niedermann.owncloud.notes.edit.NotePreviewFragment\n// (Full source code omitted for brevity)\n",
"output": "Yes",
"project": "owncloud",
"explanation": "Scenario 1: Worker thread holds UI object reference\nClass: it.niedermann.owncloud.notes.edit.NotePreviewFragment\nMethod: void lambda$onRefresh$6()\nStatement: $r4 \u003d new it.niedermann.owncloud.notes.edit.NotePreviewFragment$$ExternalSyntheticLambda4\nCaptured UI objects:\n - r0 : it.niedermann.owncloud.notes.edit.NotePreviewFragment\nRisk: UI object will be kept in memory until thread completes\nFix: Use WeakReference or avoid passing UI objects to worker threads\n"
}
{
"text_input": "package it.niedermann.owncloud.notes.edit;\n\n// Class: it.niedermann.owncloud.notes.edit.NotePreviewFragment\n// (Full source code omitted for brevity)\n",
"output": "Yes",
"project": "owncloud",
"explanation": "Scenario 1: Worker thread holds UI object re
… (truncated for brevity)
Finding #7 — BaseNoteFragment\n// (Full source code omitted for brevity)\n"
{
"text_input": "package it.niedermann.owncloud.notes.edit;\n\n// Class: it.niedermann.owncloud.notes.edit.BaseNoteFragment\n// (Full source code omitted for brevity)\n",
"output": "Yes",
"project": "owncloud",
"explanation": "Scenario 1: Worker thread holds UI object reference\nClass: it.niedermann.owncloud.notes.edit.BaseNoteFragment\nMethod: boolean onOptionsItemSelected(android.view.MenuItem)\nStatement: $r22 \u003d new it.niedermann.owncloud.notes.edit.BaseNoteFragment$$ExternalSyntheticLambda4\nCaptured UI objects:\n - r0 : it.niedermann.owncloud.notes.edit.BaseNoteFragment\nRisk: UI object will be kept in memory until thread completes\nFix: Use WeakReference or avoid passing UI objects to worker threads\n"
}
{
"text_input": "package it.niedermann.owncloud.notes.edit;\n\n// Class: it.niedermann.owncloud.notes.edit.BaseNoteFragment\n// (Full source code omitted for brevity)\n",
"output": "Yes",
"project": "owncloud",
"explanation": "Scenario 1: Worker thread holds
… (truncated for brevity)
Finding #8 — MainActivity\n// (Full source code omitted for brevity)\n"
{
"text_input": "package it.niedermann.owncloud.notes.main;\n\n// Class: it.niedermann.owncloud.notes.main.MainActivity\n// (Full source code omitted for brevity)\n",
"output": "Yes",
"project": "owncloud",
"explanation": "Scenario 1: Worker thread holds UI object reference\nClass: it.niedermann.owncloud.notes.main.MainActivity\nMethod: void lambda$onActivityResult$38(com.nextcloud.android.sso.model.SingleSignOnAccount)\nStatement: $r2 \u003d new it.niedermann.owncloud.notes.main.MainActivity$$ExternalSyntheticLambda17\nCaptured UI objects:\n - r0 : it.niedermann.owncloud.notes.main.MainActivity\nRisk: UI object will be kept in memory until thread completes\nFix: Use WeakReference or avoid passing UI objects to worker threads\n"
}
{
"text_input": "package it.niedermann.owncloud.notes.main;\n\n// Class: it.niedermann.owncloud.notes.main.MainActivity\n// (Full source code omitted for brevity)\n",
"output": "Yes",
"project": "owncloud",
"explanation": "Scenario 1: Worker
… (truncated for brevity)
Finding #9 — NoteListWidgetConfigurationActivity
Scenario 1: Worker thread holds UI object reference
Class: it.niedermann.owncloud.notes.widget.notelist.NoteListWidgetConfigurationActivity
Method: void onCreate(android.os.Bundle)
Statement: $r16 = new it.niedermann.owncloud.notes.widget.notelist.NoteListWidgetConfigurationActivity$$ExternalSyntheticLambda1
Captured UI objects:
- r0 : it.niedermann.owncloud.notes.widget.notelist.NoteListWidgetConfigurationActivity
Risk: UI object will be kept in memory until thread completes
Fix: Use WeakReference or avoid passing UI objects to worker threads
Finding #10 — SingleNoteWidgetConfigurationActivity
Scenario 1: Worker thread holds UI object reference
Class: it.niedermann.owncloud.notes.widget.singlenote.SingleNoteWidgetConfigurationActivity
Method: void onNoteClick(int,android.view.View)
Statement: $r2 = new it.niedermann.owncloud.notes.widget.singlenote.SingleNoteWidgetConfigurationActivity$$ExternalSyntheticLambda1
Captured UI objects:
- r0 : it.niedermann.owncloud.notes.widget.singlenote.SingleNoteWidgetConfigurationActivity
Risk: UI object will be kept in memory until thread completes
Fix: Use WeakReference or avoid passing UI objects to worker threads
Finding #11 — ImportAccountActivity
Scenario 1: Worker thread holds UI object reference
Class: it.niedermann.owncloud.notes.importaccount.ImportAccountActivity
Method: void lambda$onActivityResult$6(com.nextcloud.android.sso.model.SingleSignOnAccount)
Statement: $r8 = new it.niedermann.owncloud.notes.importaccount.ImportAccountActivity$$ExternalSyntheticLambda5
Captured UI objects:
- r0 : it.niedermann.owncloud.notes.importaccount.ImportAccountActivity
Risk: UI object will be kept in memory until thread completes
Fix: Use WeakReference or avoid passing UI objects to worker threads
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 notes-android.
- Lingua principale
- Java
- Stelle
- 1.1k
- Fork
- 168
- Merge medio
- 21h 49m
- PR unite (30g)
- 29
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nextcloud/notes-android
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
nextcloud/notes-android#3367 ·
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
nextcloud/notes-android#3353 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Sailfish OS native versionApertaenhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
nextcloud/notes-android#3360 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
nextcloud/notes-android#3358 ·
I maintainer di solito rispondono entro 1 giorno
-
Unable to mark as favoriteAperta0. Needs triage bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
nextcloud/notes-android#3357 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di nextcloud/notes-android
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenAPITools/openapi-generator#25014 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
openhab/openhab-core#5847 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
apache/parquet-java#3820 ·
I maintainer di solito rispondono entro 1 giorno