OutOfMemoryException on Oneplus 6
See original GitHub issueWhen running (even example) app on Oneplus 6 android 9 (OxygenOS 9.0.2) and starting the camera (doesn’t have to be reading codes) it begins to lag a lot and eventually just kills the app.
flutter doctor
:
[✓] Flutter (Channel beta, v0.10.2, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[!] Android Studio (not installed)
[✓] Connected device (2 available)
! Doctor found issues in 1 category.
Log:
...
W/System.err( 6495): java.lang.OutOfMemoryError: Failed to allocate a 5308432
byte allocation with 1275040 free bytes and 1245KB until OOM, max allowed
footprint 268435456, growth limit 268435456
W/System.err( 6495): at
com.github.rmtmckenzie.qrmobilevision.QrDetector2$QrImage.<init>(QrDetector2.jav
a:64)
W/System.err( 6495): at
com.github.rmtmckenzie.qrmobilevision.QrCameraC2$2.onImageAvailable(QrCameraC2.j
ava:186)
W/System.err( 6495): at
android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:800)
W/System.err( 6495): at android.os.Handler.dispatchMessage(Handler.java:106)
W/System.err( 6495): at android.os.Looper.loop(Looper.java:193)
W/System.err( 6495): at
android.app.ActivityThread.main(ActivityThread.java:6863)
W/System.err( 6495): at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 6495): at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537
)
W/System.err( 6495): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I/levisionexampl( 6495): Waiting for a blocking GC Alloc
I/levisionexampl( 6495): Clamp target GC heap from 268MB to 256MB
I/levisionexampl( 6495): Alloc concurrent copying GC freed 185(47KB) AllocSpace
objects, 1(10MB) LOS objects, 4% free, 244MB/256MB, paused 107us total 21.757ms
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/levisionexampl( 6495): Waiting for a blocking GC Alloc
I/levisionexampl( 6495): Clamp target GC heap from 268MB to 256MB
I/levisionexampl( 6495): Alloc concurrent copying GC freed 3(63KB) AllocSpace
objects, 0(0B) LOS objects, 4% free, 244MB/256MB, paused 76us total 18.436ms
I/levisionexampl( 6495): Forcing collection of SoftReferences for 20MB
allocation
I/levisionexampl( 6495): WaitForGcToComplete blocked Alloc on HeapTrim for
37.066ms
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/chatty ( 6495): uid=10119(com.github.rmtmckenzie.qrmobilevisionexample)
identical 1 line
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/levisionexampl( 6495): Waiting for a blocking GC Alloc
I/levisionexampl( 6495): Clamp target GC heap from 278MB to 256MB
I/levisionexampl( 6495): Alloc concurrent copying GC freed 33(47KB) AllocSpace
objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 70us total 7.746ms
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/levisionexampl( 6495): Waiting for a blocking GC Alloc
I/levisionexampl( 6495): Clamp target GC heap from 278MB to 256MB
I/levisionexampl( 6495): Alloc concurrent copying GC freed 4(88B) AllocSpace
objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 164us total 7.194ms
I/levisionexampl( 6495): Forcing collection of SoftReferences for 5MB allocation
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/levisionexampl( 6495): Waiting for a blocking GC Alloc
I/levisionexampl( 6495): Clamp target GC heap from 278MB to 256MB
I/levisionexampl( 6495): Alloc concurrent copying GC freed 27(32KB) AllocSpace
objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 39us total 8.651ms
W/levisionexampl( 6495): Throwing OutOfMemoryError "Failed to allocate a 5308427
byte allocation with 1290488 free bytes and 1260KB until OOM, max allowed
footprint 268435456, growth limit 268435456"
I/levisionexampl( 6495): WaitForGcToComplete blocked Alloc on HeapTrim for
23.964ms
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/levisionexampl( 6495): Waiting for a blocking GC Alloc
I/levisionexampl( 6495): Clamp target GC heap from 278MB to 256MB
I/levisionexampl( 6495): Alloc concurrent copying GC freed 28(47KB) AllocSpace
objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 40us total 9.289ms
W/levisionexampl( 6495): Throwing OutOfMemoryError "Failed to allocate a
21233680 byte allocation with 1273736 free bytes and 1243KB until OOM, max
allowed footprint 268435456, growth limit 268435456"
I/levisionexampl( 6495): WaitForGcToComplete blocked Alloc on HeapTrim for
9.974ms
I/levisionexampl( 6495): Starting a blocking GC Alloc
E/AndroidRuntime( 6495): FATAL EXCEPTION: AsyncTask #1
E/AndroidRuntime( 6495): Process: com.github.rmtmckenzie.qrmobilevisionexample,
PID: 6495
E/AndroidRuntime( 6495): java.lang.RuntimeException: An error occurred while
executing doInBackground()
E/AndroidRuntime( 6495): at android.os.AsyncTask$3.done(AsyncTask.java:354)
E/AndroidRuntime( 6495): at
java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime( 6495): at
java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime( 6495): at
java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime( 6495): at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime( 6495): at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime( 6495): at java.lang.Thread.run(Thread.java:764)
E/AndroidRuntime( 6495): Caused by: java.lang.OutOfMemoryError: Failed to
allocate a 21233680 byte allocation with 1273736 free bytes and 1243KB until
OOM, max allowed footprint 268435456, growth limit 268435456
E/AndroidRuntime( 6495): at
com.github.rmtmckenzie.qrmobilevision.QrDetector2$QrImage.toNv21(QrDetector2.jav
a:87)
E/AndroidRuntime( 6495): at
com.github.rmtmckenzie.qrmobilevision.QrDetector2$QrImage.access$100(QrDetector2
.java:40)
E/AndroidRuntime( 6495): at
com.github.rmtmckenzie.qrmobilevision.QrDetector2$QrTask.doInBackground(QrDetect
or2.java:135)
E/AndroidRuntime( 6495): at
com.github.rmtmckenzie.qrmobilevision.QrDetector2$QrTask.doInBackground(QrDetect
or2.java:114)
E/AndroidRuntime( 6495): at android.os.AsyncTask$2.call(AsyncTask.java:333)
E/AndroidRuntime( 6495): at
java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime( 6495): ... 3 more
I/levisionexampl( 6495): Starting a blocking GC Alloc
W/OPDiagnose( 6495): getService:OPDiagnoseService NULL
I/levisionexampl( 6495): Clamp target GC heap from 278MB to 256MB
I/levisionexampl( 6495): Alloc concurrent copying GC freed 11(46KB) AllocSpace
objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 406us total 9.427ms
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/levisionexampl( 6495): Clamp target GC heap from 278MB to 256MB
I/levisionexampl( 6495): Alloc concurrent copying GC freed 333(115KB) AllocSpace
objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 37us total 6.910ms
I/levisionexampl( 6495): Forcing collection of SoftReferences for 5MB allocation
I/levisionexampl( 6495): Starting a blocking GC Alloc
D/OSTracker( 6495): OS Event: crash
I/levisionexampl( 6495): Clamp target GC heap from 278MB to 256MB
I/levisionexampl( 6495): Alloc concurrent copying GC freed 117(46KB) AllocSpace
objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 82us total 8.570ms
W/levisionexampl( 6495): Throwing OutOfMemoryError "Failed to allocate a 5308432
byte allocation with 1190640 free bytes and 1162KB until OOM, max allowed
footprint 268435456, growth limit 268435456"
W/System.err( 6495): java.lang.OutOfMemoryError: Failed to allocate a 5308432
byte allocation with 1190640 free bytes and 1162KB until OOM, max allowed
footprint 268435456, growth limit 268435456
W/System.err( 6495): at
com.github.rmtmckenzie.qrmobilevision.QrDetector2$QrImage.<init>(QrDetector2.jav
a:64)
W/System.err( 6495): at
com.github.rmtmckenzie.qrmobilevision.QrCameraC2$2.onImageAvailable(QrCameraC2.j
ava:186)
W/System.err( 6495): at
android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:800)
W/System.err( 6495): at android.os.Handler.dispatchMessage(Handler.java:106)
W/System.err( 6495): at android.os.Looper.loop(Looper.java:193)
W/System.err( 6495): at
android.app.ActivityThread.main(ActivityThread.java:6863)
W/System.err( 6495): at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 6495): at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537
)
W/System.err( 6495): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/levisionexampl( 6495): Clamp target GC heap from 268MB to 256MB
I/levisionexampl( 6495): Alloc concurrent copying GC freed 419(106KB) AllocSpace
objects, 1(10MB) LOS objects, 4% free, 244MB/256MB, paused 41us total 6.733ms
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/levisionexampl( 6495): Clamp target GC heap from 278MB to 256MB
I/levisionexampl( 6495): Alloc concurrent copying GC freed 9(31KB) AllocSpace
objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 40us total 6.973ms
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/levisionexampl( 6495): Clamp target GC heap from 278MB to 256MB
I/levisionexampl( 6495): Alloc concurrent copying GC freed 19(608B) AllocSpace
objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 38us total 6.628ms
I/levisionexampl( 6495): Forcing collection of SoftReferences for 5MB allocation
I/levisionexampl( 6495): Starting a blocking GC Alloc
I/Process ( 6495): Sending signal. PID: 6495 SIG: 9
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:26 (10 by maintainers)
Top Results From Across the Web
Ram management on the oneplus 6 6gb is really bad can't ...
This is likely an app(s), services, or widgets or something, that's falling under "System", because the memory alloc isn't directly linked to the...
Read more >Bad RAM management on OnePlus 6. - Reddit
I've discovered this is an Android Oreo issue. It has seriously bad ram management in terms of background apps. Look at my post...
Read more >Exception : OutOfMemoryError - android - Stack Overflow
It seems from your crash logs that you have drawable which is quite large, so to avoid the OutOfMemory you have keep drawables...
Read more >OutOfMemoryException Class (System) - Microsoft Learn
The exception that is thrown when there is not enough memory to continue the execution of a program.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
any update?? up up up
The lag is gone, but I can’t get read any QRCode. OnePlus 6 w/ OOS 9.0.4
Edit: it works with CODABAR but not with QRCode.