Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of Memory when running CameraXTfLite for 25 minutes #345

Open
DavidRobb opened this issue Jan 5, 2021 · 1 comment
Open

Out of Memory when running CameraXTfLite for 25 minutes #345

DavidRobb opened this issue Jan 5, 2021 · 1 comment

Comments

@DavidRobb
Copy link

I'm tring to write an App similar to the TfLite example but am running into out of memory problems. I see the same or similar problems with the TfLite sample:

After ~ 25 minutes I get the following creash on my Moto G5 (Another One plus device appears unaffected but maybe this has more memory?)

I've tried profiling but this shows nothing odd to me
image

I/zygote: Background concurrent copying GC freed 23227(790KB) AllocSpace objects, 4(2MB) LOS objects, 50% free, 3MB/7MB, paused 188us total 119.649ms
D/CameraActivity: FPS: 0.92
D/CameraActivity: FPS: 0.88
W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
E/OpenGLRenderer: GL error:  Out of memory!
A/OpenGLRenderer: glTexImage2D error! GL_OUT_OF_MEMORY (0x505)
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 13394 (RenderThread), pid 13179 (.camerax.tflite)
I/zygote: Background concurrent copying GC freed 31173(1010KB) AllocSpace objects, 6(4MB) LOS objects, 49% free, 4MB/9MB, paused 2.447ms total 100.477ms
Disconnected from the target VM, address: 'localhost:61371', transport: 'socket'

WIth my App it fails in a similar manner after 20 minutes or so e.g:

D/CameraDetector$getAnalyzer: FPS: 0.80
I/CameraDetector$getAnalyzer: Debug native heap = 49, free = 19, used = 29 MB
I/CameraDetector$getAnalyzer: MemInfo heap = 1867, free = 631, used = 1235 MB
I/zygote: Background concurrent copying GC freed 27121(977KB) AllocSpace objects, 6(4MB) LOS objects, 49% free, 7MB/14MB, paused 167us total 320.182ms
I/zygote: Background concurrent copying GC freed 38487(1236KB) AllocSpace objects, 12(8MB) LOS objects, 49% free, 6MB/12MB, paused 680us total 352.515ms
D/CameraDetector$getAnalyzer: FPS: 0.90
I/CameraDetector$getAnalyzer: Debug native heap = 49, free = 19, used = 30 MB
I/CameraDetector$getAnalyzer: MemInfo heap = 1867, free = 642, used = 1224 MB
W/libc: pthread_create failed: couldn't allocate 1036288-bytes mapped space: Out of memory
E/libc++abi: terminating with uncaught exception of type std::__1::system_error: thread constructor failed: Try again
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 6922 (pool-2-thread-1), pid 26789 (.android.camcam)
I/zygote: Background concurrent copying GC freed 39837(1268KB) AllocSpace objects, 8(5MB) LOS objects, 49% free, 5MB/11MB, paused 367us total 212.356ms
Disconnected from the target VM, address: 'localhost:59287', transport: 'socket'

The memory heap debug reports suggest that there is plenty of memory available. Maybe it becomes too fragmented?

Any ideas suggestions?

@DavidRobb
Copy link
Author

I've isolated the problem to tfLite so asking the question there: tensorflow/tflite-support#269

Happy if you close this issue as not camerax related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant