You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had encountered a memory leak problem while debugging the initial version of android-usbser-rs. A loop polling for USB transfer data causes the problem, and it crashed on older Android versions (< 8.0).
I did an experiement and realized that attach_current_thread_permanently() prevents automatic de-allocation of JNI local references, unless making use of local frames or the AutoLocal wrapper. Is there a solution with better performance?
I had encountered a memory leak problem while debugging the initial version of
android-usbser-rs
. A loop polling for USB transfer data causes the problem, and it crashed on older Android versions (< 8.0).I did an experiement and realized that
attach_current_thread_permanently()
prevents automatic de-allocation of JNI local references, unless making use of local frames or theAutoLocal
wrapper. Is there a solution with better performance?Test program:
It causes memory leak, and crashes on older Android versions:
Put the loop in another thread, do not attach it to the JVM permanantly, then you'll not have this problem.
PS: would you like to check this issue (not important): mzdk100/droid-wrap#2.
The text was updated successfully, but these errors were encountered: