2

I am getting a JNI error of the type:

JNI ERROR (app bug): local reference table overflow (max=512)

Now, I know the reason why it happens and how to solve it but I am having some trouble finding where (CheckJNI is activated and hasn't helped me much). In order to debug this I would like to print the content of the reference table, in particular it would be quite useful to get the same message I get when the app crashes:

JNI local reference table (0x6456b0e8) dump:
07-30 11:16:12.275: W/dalvikvm(14277):   Last 10 entries (of 512):
[...]
Summary:
[...]

I haven't found a way to solve this, and the only close solution I have seen (Android JNI local reference table, dump current state) is useless now, as the class VMDebug is no longer in dalvik.system. Also, android.os.Debug (this class was referred in the old API of VMDebug) has no function to dump this table.

Is there a way to force the error message to appear? Or get something similar?

Community
  • 1
  • 1
Jorge
  • 141
  • 1
  • 9
  • At least one of these is true: You need more local reference space or you're not freeing references when you can. How does knowing the last n references created help? Why not just free each reference after its last usage? – Tom Blodget Aug 02 '14 at 22:36
  • There's some references not being freed. But the code I'm working with is huge and it isn't mine, so freeing each reference would take me too much time. I need to know the reference table content because the error happens after a long period of activity. Knowing the content would allow me to know more easily when they are created, making it easier to find the source of the problem. – Jorge Aug 03 '14 at 10:54
  • Sorry, I don't have an answer. – Tom Blodget Aug 03 '14 at 15:33
  • That's alright, I'm afraid there might be no way of accessing the content of the table. – Jorge Aug 04 '14 at 07:50
  • Dumping Reference Table: https://stackoverflow.com/questions/13283649/android-jni-local-reference-table-dump-current-state – Joaquín Luis Monleón Irisarri Aug 18 '17 at 14:36
  • That is exactly the same link I added in the question, which I already indicate doesn't help. – Jorge Nov 07 '17 at 10:04

0 Answers0