Summary
The test Mono.Android.NET_Tests, Xamarin.Android.RuntimeTests.CustomWidgetTests.InflateCustomView_ShouldNotLeakGlobalRefs is failing across multiple CI configurations.
This test was added as a regression test for a JNI global reference leak when inflating custom .NET views via LayoutInflater.Inflate. Multiple fixes have been merged across dotnet/android and dotnet/java-interop, but the test continues to fail.
Background
The global ref leak was originally reported in:
Fix attempts (all merged)
dotnet/android:
dotnet/java-interop:
Submodule bumps bringing java-interop fixes into dotnet/android:
Closed (superseded) PRs
Expected behavior
After all the above fixes, the global ref count should not grow when repeatedly inflating and GC-collecting custom views.
Actual behavior
The test still fails in CI, indicating that the global ref leak is not fully resolved or that there is a separate source of global ref growth.
Summary
The test
Mono.Android.NET_Tests, Xamarin.Android.RuntimeTests.CustomWidgetTests.InflateCustomView_ShouldNotLeakGlobalRefsis failing across multiple CI configurations.This test was added as a regression test for a JNI global reference leak when inflating custom .NET views via
LayoutInflater.Inflate. Multiple fixes have been merged acrossdotnet/androidanddotnet/java-interop, but the test continues to fail.Background
The global ref leak was originally reported in:
Fix attempts (all merged)
dotnet/android:
dotnet/java-interop:
Submodule bumps bringing java-interop fixes into dotnet/android:
85919bbto7b018fe#11125 — Bump Java.Interop (includes [Java.Interop] fix global ref leak in ConstructPeer java-interop#1403)7b018feto69c9daa#11171 — Bump Java.Interop (includes [Java.Interop] Defer exception creation in TryLoadClassWithFallback to fix global ref leak java-interop#1410)Closed (superseded) PRs
Expected behavior
After all the above fixes, the global ref count should not grow when repeatedly inflating and GC-collecting custom views.
Actual behavior
The test still fails in CI, indicating that the global ref leak is not fully resolved or that there is a separate source of global ref growth.