Skip to content

[release/10.0.1xx] [tests] Add regression test for global ref leak in LayoutInflater.Inflate#11134

Merged
jonathanpeppers merged 1 commit intorelease/10.0.1xxfrom
dev/peppers/backport-gref-leak
Apr 16, 2026
Merged

[release/10.0.1xx] [tests] Add regression test for global ref leak in LayoutInflater.Inflate#11134
jonathanpeppers merged 1 commit intorelease/10.0.1xxfrom
dev/peppers/backport-gref-leak

Conversation

@jonathanpeppers
Copy link
Copy Markdown
Member

Fixes: #11101
Fixes: #10989

The fix is in Java.Interop (ConstructPeer + Dispose for Invalid refs), included via the submodule bump. This adds an on-device regression test that inflates 100 custom views and asserts the JNI global reference count does not grow significantly.

…late (#11112)

Fixes: #11101
Fixes: #10989

The fix is in Java.Interop (ConstructPeer + Dispose for Invalid refs),
included via the submodule bump. This adds an on-device regression test
that inflates 100 custom views and asserts the JNI global reference
count does not grow significantly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 16, 2026 20:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an on-device regression test in the Mono.Android test suite to detect JNI global reference growth when repeatedly inflating an AXML layout containing a custom managed view (intended to guard against the global-ref leak described in dotnet/android #11101 / #10989, with the underlying fix coming from the Java.Interop submodule bump).

Changes:

  • Add a new device test that inflates a custom-view layout many times and asserts Java.Interop.Runtime.GlobalReferenceCount doesn’t grow beyond a threshold.
  • Add GC “warm-up” and collection steps around the measurement to reduce noise.

@jonathanpeppers
Copy link
Copy Markdown
Member Author

Only failure is Build_JLO_Change, we can ignore -- flaky test.

@jonathanpeppers jonathanpeppers merged commit b7e7191 into release/10.0.1xx Apr 16, 2026
5 of 6 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/peppers/backport-gref-leak branch April 16, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants