Bug 55286 - Java.Interop.JniRuntime.CurrentRuntime.WeakGlobalReferenceCount always returns -1.
Summary: Java.Interop.JniRuntime.CurrentRuntime.WeakGlobalReferenceCount always return...
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: 7.2 (15.1)
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2017-04-17 15:09 UTC by Jon Douglas [MSFT]
Modified: 2017-06-23 17:32 UTC (History)
2 users (show)

See Also:
Tags: bb
Is this bug a regression?: ---
Last known good build:


Attachments

Description Jon Douglas [MSFT] 2017-04-17 15:09:44 UTC
*Description:

The following API seems to always return -1:

Java.Interop.JniRuntime.CurrentRuntime.WeakGlobalReferenceCount

https://github.com/xamarin/xamarin-android/blob/master/src/Mono.Android/Android.Runtime/AndroidRuntime.cs#L81-L83

*Expected Result:

Should return the current Weak Reference Count

*Actual Result:

Returns -1

*Version Information:

Microsoft Visual Studio Enterprise 2017 
Version 15.1 (26403.0) Release
VisualStudio.15.Release/15.1.0+26403.0
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Xamarin   4.4.0.34 (3f99c5a)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.2.0.7 (b16fb82)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.8.0.174 (7656cc6)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 1 Mark McLemore 2017-06-23 17:32:34 UTC
Confirmed by examining the AndroidRuntime.cs source (above) and via corroboration on SO: https://stackoverflow.com/questions/43403968/how-do-i-diagnose-the-cause-of-a-xamarin-android-weak-reference-table-overflow

Note You need to log in before you can comment on or make changes to this bug.