Android Question Barcode Scanner memory problems

Ramon Bustamante

Member
Licensed User
Based on https://www.b4x.com/android/forum/t...feb-2016-new-library-files-in-post-105.60155/ it seems that there are problems with the library because the available memory after call it decrease a lot and this happens every time the proccess it is called.

Based on the application b4aZXscannerLiveView.zip I develop an activity with a call to a su to obtain the free memory:

Sub GetFreeMemory As String

Dim r As Reflector
r.Target = r.RunStaticMethod("java.lang.Runtime", "getRuntime", Null, Null)
Return ("available Memory = " & ((r.RunMethod("maxMemory") - r.RunMethod("totalMemory"))/(1024*1024)) & " MB")

End Sub
 

Johan Schoeman

Expert
Licensed User
Longtime User
Upvote 0

Ramon Bustamante

Member
Licensed User
Ramon, got to the thread at the link below. I have done some tests by setting obj and zxslv to null. Does not seem to make too much of a difference.

https://www.b4x.com/android/forum/threads/memory-leaks.85126/

How do you get obj an zxslv to null. If I put zxslv=null I obtain: java.lang.RuntimeException: Object should first be initialized (zxScannerLiveView).
In the thread of the link nothing relevant for the use it said.

I think that there is a memory leak in ZxScannerLiveView.jar because every time a bar code scan is made, memory disappears.
 
Upvote 0
Top