"global reference table overflow" exception with very large numbers of "mono.java.lang.RunnableImplementor" #15769
-
Hello everyone, I've had a crash in a MAUI application of mine with the following message: I've created this as a discussion and I don't know whether this is my fault or an issue with MAUI. If anybody has any ideas of how I could investigate this further I'd love to hear them. I also have a complete copy of the debug output from Visual Studio. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
So the solution to this ended up being: be careful when using Android.View.Post(Action) when there's a chance that the view might not be attached to a window. This method will create a RunnableImplementor and call Post(IRunnable) with it. RunnableImplementor's constructor adds it to a dictionary to keep a hold of the reference, which it is then removed from at the end of the Run implementation. Problems arise when Run isn't called, such as when the View is detached from a Window and then destroyed, as the RunnableImplementor will sit there taking up memory and JNI handles forever, and presumably preserving references to whatever is used within the Action as well. Normally it would be cleaned with the View's mRunQueue, but the presence of the C#-side dictionary causes it to persist in this scenario. |
Beta Was this translation helpful? Give feedback.
-
I have a very similar issue [0:] Navigating to Web Media #: https://fast.com/ |
Beta Was this translation helpful? Give feedback.
So the solution to this ended up being: be careful when using Android.View.Post(Action) when there's a chance that the view might not be attached to a window. This method will create a RunnableImplementor and call Post(IRunnable) with it. RunnableImplementor's constructor adds it to a dictionary to keep a hold of the reference, which it is then removed from at the end of the Run implementation. Problems arise when Run isn't called, such as when the View is detached from a Window and then destroyed, as the RunnableImplementor will sit there taking up memory and JNI handles forever, and presumably preserving references to whatever is used within the Action as well. Normally it would be clea…