I am working with an application having totally work with Images and Videos. I am storing all the images and videos of device into database of application and this task is performing in a background service. Between this process I am checking for detecting face in image using getFacesFromBitmap(mBitmap).
The problem is that sometime I am getting error java.lang.StackOverflowError: stack size 1036KB and sometimes I am getting OOM error.
So is there any best way to solve this issue?