ita33 opened a new issue #710:
URL: https://github.com/apache/cordova-plugin-camera/issues/710


   # Bug Report
   
   ## Problem
   After taking somewhere between 195 to 218 photos on Android 11, the app (and 
sometimes the entire device) will crash.  Performed this test several times on 
same device running Android 10 and able to surpass 1,000 photos without 
crashing. 
   
   ### What is expected to happen?
   The camera should continue functioning without crashing the application or 
device
   
   
   ### What does actually happen?
   The app crashes. Root error appears to be an out of memory error which 
matches all the symptoms; camera getting slower and slower until crash, app not 
working properly until device re-booted. If user continues to press camera 
capture button, while the screen is frozen, the device will sometimes crash.
   
   ## Information
   Stack trace:
   
   02-15 18:02:36.390 13006 13257 E AndroidRuntime: Process: 
com.google.android.GoogleCamera, PID: 13006
   02-15 18:02:36.390 13006 13257 E AndroidRuntime: java.lang.OutOfMemoryError: 
Failed to allocate a 1981728 byte allocation with 550752 free bytes and 537KB 
until OOM, target footprint 536870912, growth limit 536870912
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at 
java.util.Arrays.copyOf(Arrays.java:3161)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at 
java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at 
java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at 
java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at qlc.write(PG:2)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at 
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at 
java.io.BufferedOutputStream.write(BufferedOutputStream.java:126)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at ngk.b(PG:1)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at ngl.write(PG:7)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at 
com.google.common.io.ByteStreams.copy(PG:4)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at 
com.google.android.libraries.camera.exif.ExifInterface.h(PG:4)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at ilz.R(PG:7)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at icg.run(PG:87)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at ibb.run(PG:2)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at 
java.lang.Thread.run(Thread.java:923)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     at msl.run(PG:2)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:     Suppressed: 
java.lang.OutOfMemoryError: Failed to allocate a 1981728 byte allocation with 
542240 free bytes and 529KB until OOM, target footprint 536870912, growth limit 
536870912
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:             at 
java.util.Arrays.copyOf(Arrays.java:3161)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:             at 
java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:             at 
java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:             at 
java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:             at 
qlc.write(PG:2)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:             at 
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:             at 
java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:             at 
java.io.FilterOutputStream.close(FilterOutputStream.java:179)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:             at 
ngl.close(PG:4)
   02-15 18:02:36.390 13006 13257 E AndroidRuntime:             at 
com.google.android.libraries.camera.exif.ExifInterface.h(PG:3)
   
   
   ### Command or Code
   
   
   ### Environment, Platform, Device
   Android 11 on a Samsung S20 and a Google Pixel 4XL
   The camera will go beyond 1,000 consecutive photos without crashing the app 
on Android 6 thru Android 10 (same devices running Android 10; different 
devices running Android 6 thru 9)
   
   ### Version information
   cordova 10.0.0
   cordova android 9.0.0
   cordova-plugin-camera 5.0.1
   Have also tested dev version of cordova-plugin-camera 5.0.2 that included 
the fix for ticket #665 and the same crash happens. We've been following ticket 
#665 closely hoping that it would fix this issue, but it did not.
   
   ## Checklist
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to