简体   繁体   中英

What is the “weak global reference table”?

After playing a video in the WebView on Android for a bit I get this crash. I'm sure I'm doing something wrong on my end since I can't reproduce it on other WebView browsers but first I want to understand what the weak global reference table is? is it for WeakRerefence instances?

Thanks.

 java_vm_ext.cc:662] JNI ERROR (app bug): weak global reference table overflow (max=51200)weak global reference table dump:
 java_vm_ext.cc:662]   Last 10 entries (of 51200):
 java_vm_ext.cc:662]     51199: 0x1d040028 java.lang.Thread
 java_vm_ext.cc:662]     51198: 0x1d000028 java.lang.Thread
 java_vm_ext.cc:662]     51197: 0x1cfc0028 java.lang.Thread
 java_vm_ext.cc:662]     51196: 0x1cf80028 java.lang.Thread
 java_vm_ext.cc:662]     51195: 0x1cf40028 java.lang.Thread
 java_vm_ext.cc:662]     51194: 0x1cf00028 java.lang.Thread
 java_vm_ext.cc:662]     51193: 0x1cec0028 java.lang.Thread
 java_vm_ext.cc:662]     51192: 0x1ce80028 java.lang.Thread
 java_vm_ext.cc:662]     51191: 0x1ce40028 java.lang.Thread
 java_vm_ext.cc:662]     51190: 0x1cdc0028 java.lang.Thread
 java_vm_ext.cc:662]   Summary:
 java_vm_ext.cc:662]     26835 of java.lang.Thread (26832 unique instances)
 java_vm_ext.cc:662]     22377 of java.lang.Class (22377 unique instances)
 java_vm_ext.cc:662]      1395 of com.facebook.stetho.server.LocalSocketServer$WorkerThread (1395 unique instances)
 java_vm_ext.cc:662]       228 of java.util.TimerThread (227 unique instances)

Edit: Just to be clear, I've seen a few answers about the global reference table but not about the global reference table . global reference table答案。

Edit: it appears that the crash only happens while the app is being debugged.

Quoted from Stephen Nelson

Your code is failing because you have too many global references to objects that have not been released back into the memory pool

Here is the link to the link for the full answer Why do I need to release global references created in JNI native functions?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM