saki4510t / UVCCamera

library and sample to access to UVC web camera on non-rooted Android device
2.99k stars 1.2k forks source link

Why is my native heap increasing? #517

Closed alless1 closed 4 years ago

alless1 commented 4 years ago

As I kept turning on and off the camera, I dumpsys meminfo showed that Native Heap was rising and could not be released. Not even calling GC. I'm sure I've completely freed up resources at the Java layer. After testing, I found that this would not happen without setFrameCallback, but why? Please help me, thank you. @saki4510t

yzq666 commented 4 years ago

I also encountered your problem. Thank you for your test. If you have any solution, please contact me. 846384016@qq.com

alless1 commented 4 years ago

It's because I performed a mCamera.destroy() in the onFrame method; the native heap cannot be freed. It's amazing.

alless1 commented 4 years ago

I also encountered your problem. Thank you for your test. If you have any solution, please contact me. 846384016@qq.com Do not release resources in callback threads