Comments (3)
Same here, I am using the android java contacts api and the app crashes due to this error
JNI ERROR (app bug): local reference table overflow (max=512)
W/dalvikvm(27097): JNI local reference table (0x57901190) dump:
W/dalvikvm(27097): Last 10 entries (of 512):
W/dalvikvm(27097): 511: 0x41e5e950 android.os.Parcel
W/dalvikvm(27097): 510: 0x41e594f0 android.os.BinderProxy
W/dalvikvm(27097): 509: 0x41e53f80 java.lang.String "552"
W/dalvikvm(27097): 508: 0x41eb0018 java.lang.String[] (1 elements)
W/dalvikvm(27097): 507: 0x41f083a8 java.lang.String "551"
W/dalvikvm(27097): 506: 0x41e53f30 java.lang.String "contact_id = ?"
W/dalvikvm(27097): 505: 0x41f07230 java.lang.String "545"
W/dalvikvm(27097): 504: 0x416c70e0 java.lang.Class<java.lang.String>
W/dalvikvm(27097): 503: 0x41edbdf0 java.lang.String "1730"
W/dalvikvm(27097): 502: 0x416c70e0 java.lang.Class<java.lang.String>
W/dalvikvm(27097): Summary:
W/dalvikvm(27097): 267 of java.lang.Class (18 unique instances)
W/dalvikvm(27097): 242 of java.lang.String (242 unique instances)
W/dalvikvm(27097): 1 of java.lang.String[] (1 elements)
W/dalvikvm(27097): 1 of android.os.Parcel
W/dalvikvm(27097): 1 of android.os.BinderProxy
E/dalvikvm(27097): Failed adding to JNI local ref table (has 512 entries)
from pyjnius.
@tshirtman ref this answer and #371. I'm not sure we would be able to somehow overcome this. If the table has that limitation, we can only make sure we remove our references right after we don't need them. We might try to store the refs on the Python side, but I don't think JNI would be happy about that and it'd just collect the objects or just return segfault, no?
However we might switch to PushLocalFrame()
/PopLocalFrame()
in places where we create our local refs to be really sure the refs are gone, though it might cause more harm due to us not being able to track the refs and we might end up with prematurely collected refs.
Minor sidenote: I've been able to autoclass('android.webkit.WebView')
just fine and I don't think my JNI table size has been altered, so I'd say #371 did a good job for fixing this issue and I'd close it.
from pyjnius.
In Android versions prior to Android 8.0, the number of local references is capped at a version-specific limit. Beginning in Android 8.0, Android supports unlimited local references.
ref Android JNI docs
from pyjnius.
Related Issues (20)
- pyjnius build error on s390x HOT 10
- ClassNotFoundException for android.media.midi.MidiManager.OnDeviceOpenedListener HOT 3
- unexpected error for jdk17 HOT 4
- Crashes on Apple M1 HOT 27
- How to add everything under M2 repository to pyjnius classpath? HOT 2
- DeprecationWarning: pkg_resources is deprecated as an API
- pyjnius build error, still coming HOT 10
- Including a JAR on Android HOT 2
- Support mail address is broken HOT 2
- OverflowError: value too large to convert to jshort HOT 4
- How to create Webview with FileChooser HOT 1
- Moderinze `java` code? HOT 2
- installation documentation could be refreshed HOT 3
- Usage without JDK HOT 6
- AttributeError: 'Class' object has no attribute '_JavaClass__cls_storage' HOT 4
- Running python script on Android but in Docker container HOT 1
- Getting a pointer to JavaVM
- Dependency Dashboard
- No jvm.dll found HOT 3
- Unrecognized option: --add-exports / --add-opens HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyjnius.