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'm making a simple Android app that needs to repeatedly make photos every second while it's operational. I delete the photos that are more than a minute old from the file system. This I achieve through roughly the following code:
Everything works fine for a while, however the app consistently ceases to function after roughly 14 minutes of taking pictures. IDE doesn't throw any error upon termination, it just stops. Moreover, after that if the app is launched again it will crash shortly after the launch. This is not fixed by deinstalling and reinstalling the app or restarting the emulator. The only fix I was able to discover is wiping user data from the emulator.
After some testing and experimentation I was able to narrow the issue down to the line where pictures are taken (if this line is commented the app works indefinitely just fine):
fotoapparat?.takePicture()?.saveToFile(curFile)
Moreover, upon more experimentation I discovered, that even after disabling saving the photos (the saveToFile() part), calling fotoapparat.takePicture() alone still leads to the same effect within the same timespan.
I've monitored the app through Android Studio memory profiler and discovered the steady increase in "Others" memory consumption throughout the process, seemingly displacing other memory categories, until the big spike leads to app's crash.
I'm making a simple Android app that needs to repeatedly make photos every second while it's operational. I delete the photos that are more than a minute old from the file system. This I achieve through roughly the following code:
Everything works fine for a while, however the app consistently ceases to function after roughly 14 minutes of taking pictures. IDE doesn't throw any error upon termination, it just stops. Moreover, after that if the app is launched again it will crash shortly after the launch. This is not fixed by deinstalling and reinstalling the app or restarting the emulator. The only fix I was able to discover is wiping user data from the emulator.
After some testing and experimentation I was able to narrow the issue down to the line where pictures are taken (if this line is commented the app works indefinitely just fine):
Moreover, upon more experimentation I discovered, that even after disabling saving the photos (the saveToFile() part), calling fotoapparat.takePicture() alone still leads to the same effect within the same timespan.
I've monitored the app through Android Studio memory profiler and discovered the steady increase in "Others" memory consumption throughout the process, seemingly displacing other memory categories, until the big spike leads to app's crash.
How did you initialize FA?
What was the result you received?
The app crashes without errors after approximately 14 minutes of consecutively taking pictures.
What did you expect?
App proceeds to operate indefinitely.
Context:
The text was updated successfully, but these errors were encountered: