Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[LeakScope] 11 Android lifecycle/memory violations detected

オープン
#3,188 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
android, java
領域
mobile-dev

調査の方向性

まず、NotePreviewFragment、NoteEditFragment、AboutFragmentLicenseTab、BrandingUtil、および影響を受ける Activities を含む、列挙されたクラスとメソッドを確認し、報告された Lifecycle、State-Holder、Worker-Thread に関する各参照を検証します。11 件の Findings をすべて評価し、確認された leaks に対処するか、False Positives を Issue コメントに記録すれば完了です。ソースファイルやテストは指定されていません。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Java
スター
1.1k
フォーク
168
平均マージ
20時間 11分
マージ済み PR(30日)
28

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nextcloud/notes-android のほかの issue

nextcloud/notes-android の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。