-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run_on_ui_thread crashes with local reference table overflow when called multiple times #164
Comments
I've hit the same issues few days ago, but reported it in the wrong project: kivy/pyjnius#83 |
following coded crashed too
seems any interface implementation instantiated more than 25X times at once would cause reference overflow! |
This kivy code also produces the
Which gives me the error:
In my use case I have a google map widget in the ui thread and a timer to periodically poll the user location. Is there a work around? |
Has someone found a workaround? Some calls need to be made in the ui thread and running a function decorated with |
This is a workaround solution for this problem. I found that every call to any function decorated with @run_in_ui_thread creates a new entry in the table of jni references, even if the call is for the same function multiple times. The solution is keep a dictionary with all the functions called, and reused instead of create a Runnable in every @run_in_ui_thread call. I think this solution is only usefull for call a limited number of different functions, maximum 490 functions approximately. The changes must be made to the file: And the complete new changes are: #start file
#endfile and this is the pull request #1830 |
With the test program below, after ~250 iterations, it crashes with local reference table overflow. Program and logcat is attached.
main.py
Logcat:
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: