Code Monkey home page Code Monkey logo

Comments (3)

jitendranair avatar jitendranair commented on August 28, 2024

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.

KeyWeeUsr avatar KeyWeeUsr commented on August 28, 2024

@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.

KeyWeeUsr avatar KeyWeeUsr commented on August 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.