dotnet / dotnet/android

Potential ANR / GC regression in .NET 10 Android compared to .NET 9

Open
#11,327 13 comments 0 reactions 0 assignees View on GitHub
need-attention
Dominant language
C#
Stars
2.1k
Forks
579
Avg merge
1d 19h
Merged PRs (30d)
252

Description

### Android framework version

net10.0-android

### Affected platform version

Vs2026 net10

### Description

We are seeing a significant increase in ANRs after moving our Android app from .NET 9 to .NET 10.

The same application and usage pattern appears stable on .NET 9, but when targeting .NET 10 we start receiving frequent ANR reports in Google Play Console.

Important detail:
Crashlytics does not report corresponding fatal crashes. The app appears to freeze / become unresponsive rather than crash with an uncaught exception.

Observed behavior:
- .NET 9 Android build: ANRs are gone or extremely rare
- .NET 10 Android build: ANRs return frequently
- Same app logic
- Same user workflow
- Same devices / customers
- No matching Crashlytics crashes

ANR traces often include native/runtime/GC related frames such as:
- art::gc::collector::ConcurrentCopying
- Runtime.gc
- libart.so
- Android Runtime / GC activity

App context:
- Android POS / hospitality application
- Built with C# / .NET for Android
- Uses multiple Activities
- Heavy UI rendering in some screens
- Uses FFImageLoading / SVG image rendering and caching
- ANRs appear sporadic, not always reproducible locally

We already tested disabling several build/runtime optimizations:

false
None
false
false

These changes did not eliminate the ANRs in .NET 10.

Additional observations:
- Adding more awaits / avoiding synchronous UI-heavy operations reduced ANRs, but did not fully explain the difference between .NET 9 and .NET 10.
- The strongest signal is that .NET 9 behaves normally while .NET 10 produces ANRs under similar real-world usage.

Could there be a runtime / GC / Android workload regression in .NET 10 that could cause longer stalls or ANRs compared to .NET 9?

What diagnostic information would be most useful for us to provide?

### Steps to Reproduce

1. Build and deploy the application using .NET 10 for Android in Release mode.
2. Use the application under normal production workload:
- frequent Activity navigation
- image rendering
- SVG/image caching
- async network/database operations
3. Leave the application running during real-world usage for extended periods.
4. After some time, Android starts reporting ANRs in Google Play Console.

Observed result:
- ANRs occur sporadically
- ANR traces frequently contain GC/runtime related frames:
- art::gc::collector::ConcurrentCopying
- Runtime.gc
- libart.so
- Firebase Crashlytics does not report matching fatal crashes.

Important comparison:
- Rebuilding the same application on .NET 9 significantly reduces or eliminates the ANRs under the same workload and devices.

### Did you find any workaround?

_No response_

### Relevant log output

```shell

```
Most of errors contains Mediatek MT6769 processor

[error1.txt](https://github.com/user-attachments/files/27652591/error1.txt)
[error2.txt](https://github.com/user-attachments/files/27652672/error2.txt)
Image
Image

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.