Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Memory Leak Switching Activities

Open
#12,253 9 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
android, csharp

Research direction

Start with the linked LeakTest application and reproduce the activity switching on an Android device while watching native memory in Android Studio Live Telemetry. Compare behavior with and without GC.Collect() in OnDestroy() or OnCreate(), then trace the activity lifecycle and native allocation path implicated by the reproduction. Done means repeated switching no longer causes unbounded native-memory growth or an application crash.

Written by the indexing model from the issue text.

Description

Area: Performance
Android framework version

net11.0-android (Preview)

Affected platform version

Visual Studio 2026 v18.7.3

Description

Having experienced the same issue as https://github.com/dotnet/android/issues/10989 I tested the fix in .NET11 Preview 6 but it still seems to be present.

Created a small app which auto switches between 2 activities the native memory increases until the application crashes. Memory viewed in Android Studio Live Telemetry.

Image
Steps to Reproduce

Install application on an Android device from https://github.com/dodgei/android_leak/tree/main/LeakTest

Witness the climbing native memory in a profiler.

Did you find any workaround?

I found that calling GC.Collect(); in OnDestroy(); or OnCreate(); keeps the memory stable

Relevant log output

Dominant language
C#
Stars
2.1k
Forks
581
Avg merge
2d 33m
Merged PRs (30d)
204

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/android

All issues in dotnet/android

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.