FATAL EXCEPTION: FrescoDecodeExecutor-2 - android

I got the crash FATAL EXCEPTION: FrescoDecodeExecutor-2
Throwing OutOfMemoryError "Failed to allocate a 64256268 byte allocation with 16777216 free bytes and 49MB until OOM"
StackTrace :
java.lang.OutOfMemoryError: Failed to allocate a 64256268 byte allocation with 16777216 free bytes and 49MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:905)
at android.graphics.Bitmap.createBitmap(Bitmap.java:882)
at android.graphics.Bitmap.createBitmap(Bitmap.java:849)
at com.facebook.imagepipeline.memory.BitmapPool.alloc(BitmapPool.java:51)
at com.facebook.imagepipeline.memory.BitmapPool.alloc(BitmapPool.java:26)
at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:255)
at com.facebook.imagepipeline.platform.ArtDecoder.decodeStaticImageFromStream(ArtDecoder.java:147)
at com.facebook.imagepipeline.platform.ArtDecoder.decodeJPEGFromEncodedImage(ArtDecoder.java:127)
at com.facebook.imagepipeline.decoder.DefaultImageDecoder.decodeJpeg(DefaultImageDecoder.java:173)
at com.facebook.imagepipeline.decoder.DefaultImageDecoder$1.decode(DefaultImageDecoder.java:56)
at com.facebook.imagepipeline.decoder.DefaultImageDecoder.decode(DefaultImageDecoder.java:119)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.doDecode(DecodeProducer.java:254)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.access$300(DecodeProducer.java:113)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$1.run(DecodeProducer.java:152)
at com.facebook.imagepipeline.producers.JobScheduler.doJob(JobScheduler.java:202)
at com.facebook.imagepipeline.producers.JobScheduler.access$000(JobScheduler.java:22)
at com.facebook.imagepipeline.producers.JobScheduler$1.run(JobScheduler.java:73)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:51)
at java.lang.Thread.run(Thread.java:761)
Image is 5,34 Mo big 5344x3006 and was shoot by the phone Motorola XT1562, Android 7.1.1
implementation 'com.facebook.fresco:fresco:1.9.0'
Of course it does not reproduced every time the app is running
What's wrong ? Help ! :-)

Related

How to FIX OutOfMemoryError for seemingly very light resource 64 byte

I have got a android.view.InflateException, and further down the stacktrace, I've got this outOfMemory exception at the line where a 4 kb XML drawable is loaded with srcCombat into an AppCompatImageView.
<androidx.appcompat.widget.AppCompatImageView
android:id="#+id/img_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_menu_profile_arrow" />
StackTrace::
Caused by java.lang.OutOfMemoryError: Failed to allocate a 64 byte allocation with 3187176 free bytes and 3112KB until OOM, target footprint 402653184, growth limit 402653184; giving up on allocation because <1% of heap free after GC.
at android.graphics.drawable.VectorDrawable.inflateChildElements(VectorDrawable.java:853)
at android.graphics.drawable.VectorDrawable.inflate(VectorDrawable.java:752)
Whats the meaning of this, I mean, if there is 3187176 free bytes why can't a 64 byte be allocated?
Whats the meaning of OOM, target footprint, and growth limit.

I don't know why my device keeps disconnecting in flutter

I/utter_travelin(31159): Clamp target GC heap from 53MB to 48MB
I/utter_travelin(31159): Forcing collection of SoftReferences for 64KB allocation
I/utter_travelin(31159): Starting a blocking GC Alloc
I/utter_travelin(31159): Clamp target GC heap from 53MB to 48MB
I/utter_travelin(31159): Alloc concurrent copying GC freed 20(712B) AllocSpace objects, 0(0B) LOS objects, 0% free, 47MB/48MB, paused 5us total 7.039ms
I/utter_travelin(31159): WaitForGcToComplete blocked Background on HeapTrim for 6.238ms
W/utter_travelin(31159): Throwing OutOfMemoryError "Failed to allocate a 65552 byte allocation with 53984 free bytes and 52KB until OOM, target footprint 50331648, growth limit 50331648" (VmSize 9934428 kB)
E/AndroidRuntime(31159): FATAL EXCEPTION: pool-1-thread-1
E/AndroidRuntime(31159): Process: com.example.flutter_traveling, PID: 31159
E/AndroidRuntime(31159): java.lang.OutOfMemoryError: Failed to allocate a 65552 byte allocation with 53984 free bytes and 52KB until OOM, target footprint 50331648, growth limit 50331648
E/AndroidRuntime(31159): at com.android.internal.util.FastXmlSerializer.<init>(FastXmlSerializer.java:86)
E/AndroidRuntime(31159): at com.android.internal.util.FastXmlSerializer.<init>(FastXmlSerializer.java:75)
E/AndroidRuntime(31159): at com.android.internal.util.XmlUtils.writeMapXml(XmlUtils.java:195)
E/AndroidRuntime(31159): at android.app.SharedPreferencesImpl.writeToFile(SharedPreferencesImpl.java:778)
E/AndroidRuntime(31159): at android.app.SharedPreferencesImpl.access$900(SharedPreferencesImpl.java:55)
E/AndroidRuntime(31159): at android.app.SharedPreferencesImpl$2.run(SharedPreferencesImpl.java:647)
E/AndroidRuntime(31159): at android.app.SharedPreferencesImpl.enqueueDiskWrite(SharedPreferencesImpl.java:666)
E/AndroidRuntime(31159): at android.app.SharedPreferencesImpl.access$100(SharedPreferencesImpl.java:55)
E/AndroidRuntime(31159): at android.app.SharedPreferencesImpl$EditorImpl.commit(SharedPreferencesImpl.java:585)
E/AndroidRuntime(31159): at io.flutter.plugins.sharedpreferences.MethodCallHandlerImpl$1.run(MethodCallHandlerImpl.java:143)
E/AndroidRuntime(31159): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(31159): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(31159): at java.lang.Thread.run(Thread.java:919)
I/utter_travelin(31159): Clamp target GC heap from 53MB to 48MB
W/System (31159): A resource failed to call close.
I/Process (31159): Sending signal. PID: 31159 SIG: 9
Lost connection to device.
Exited (sigterm)
Device keeps disconnecting from flutter, I don't know why, please help
In the Android simulator, this phenomenon is occurring continuously, and in ios, it works without any problem.
The Error Log shows
Throwing OutOfMemoryError
If you run your project on an emulator please clean it or uninstall your app.

How to find location of non fatal error in Android's logcat

I'm getting some non fatal errors on my logcat but no line numbers or anything else that can help me locate the error.
As you can see, I'm getting several, including Cursor finalized without prior close() and Window is full, but no idea how to find them.
09-26 14:20:47.743: W/CursorWindow(2090): Window is full: requested allocation 756 bytes, free space 150 bytes, window size 2097152 bytes
09-26 14:20:48.151: D/dalvikvm(2090): GC_FOR_ALLOC freed 1686K, 3% free 90204K/92076K, paused 108ms, total 112ms
09-26 14:20:48.159: W/CursorWrapperInner(2090): Cursor finalized without prior close()
09-26 14:20:48.163: W/CursorWrapperInner(2090): Cursor finalized without prior close()
09-26 14:20:49.759: D/dalvikvm(2090): GC_FOR_ALLOC freed 910K, 2% free 91343K/92436K, paused 115ms, total 115ms
09-26 14:20:51.127: D/dalvikvm(2090): GC_FOR_ALLOC freed 731K, 1% free 92661K/93576K, paused 70ms, total 70ms
09-26 14:20:52.195: D/dalvikvm(2090): GC_FOR_ALLOC freed 683K, 1% free 94024K/94892K, paused 71ms, total 71ms
09-26 14:20:53.303: D/dalvikvm(2090): GC_FOR_ALLOC freed 713K, 1% free 95360K/96256K, paused 77ms, total 77ms
09-26 14:20:54.403: D/dalvikvm(2090): GC_FOR_ALLOC freed 706K, 1% free 96702K/97592K, paused 84ms, total 84ms
09-26 14:20:54.755: W/CursorWindow(2090): Window is full: requested allocation 756 bytes, free space 645 bytes, window size 2097152 bytes
09-26 14:20:55.559: D/dalvikvm(2090): GC_FOR_ALLOC freed 752K, 1% free 98000K/98936K, paused 76ms, total 76ms
Any tips?
Thanks!
This kind of errors are not exceptions thrown by the program and will therefore not contain a stack-trace. As a general rule of thumb you may find ways to optimize your code by carefully reading the error message and read into the subject concerning the error.
As far as I can see it is a problem with allocation of memory. I don't think you can pinpoint them to a specific position in your execution flow since it will probably occur at different points in execution. You can think about your code to see if you can find some memory optimization possibilities.
If you want to analyze your code thoroughly you may want to use a tool like 'Eclipse MAT'. Read this tutorial to learn how to use the tool
Do a global file search looking for text like ".query(" in your .java files.
That should lead you to places where a Cursor is returned and from there you should be able to determine where they are not being closed.

Adobe Air Camera Issue

Dont know if anyone has come across this issue but I am creating an app for mobile devices and it runs fine on my galaxy s2 running ics 4.0.4 however when I run it on the galaxy tab running 2.3.3 it keeps throwing errors.
All that I am doing is getting the device camera and attaching it to a flash.media.Video. I have the suspicion that the amount of errors caused by this issues is severly affecting the perfomance.
I have attached an fxp file ( https://www.box.com/s/77a9460edcf8a7ce95ee ) so that you can see that I am not doing anything out of the ordinary.
THanks for your help!
P.S.
Here is a sample segment of the logcat-
D/TvOut-Engine( 79): (isHdmiCableConnected): mHdmiCableConnected 0
D/CameraHardwareSec( 75): MemoryHeapBase(fd(26), size(5760128), width(800), height(600))
W/AudioFlinger( 75): RecordThread: buffer overflow
D/dalvikvm(12597): GC_FOR_MALLOC freed 1206K, 48% free 4217K/8007K, external 4034K/4493K, paused 91ms
V/AudioHardwareALSA( 75): resampler read error -32
D/AudioHardwareALSA( 75): AudioStreamInALSA::read error -32
D/AudioHardwareALSA( 75): AudioStreamInALSA::snd_pcm_recover error 0
E/v4l2_utils( 75): Error = Invalid argument from qbuf
E/CameraHardwareSec( 75): ERR(int android::CameraHardwareSec::previewThread()):overlay queueBuffer fail
I/dalvikvm-heap(12597): Grow heap (frag case) to 16.060MB for 5760016-byte allocation
D/dalvikvm(12597): GC_FOR_MALLOC freed 203K, 30% free 9638K/13639K, external 3975K/4493K, paused 26ms
E/v4l2_utils( 75): Error = Invalid argument from qbuf
E/CameraHardwareSec( 75): ERR(int android::CameraHardwareSec::previewThread()):overlay queueBuffer fail
D/dalvikvm(12597): GC_CONCURRENT freed 91K, 31% free 9547K/13639K, external 3975K/4493K, paused 2ms+13ms
D/dalvikvm(12597): GC_FOR_MALLOC freed 76K, 31% free 9471K/13639K, external 3975K/4493K, paused 43ms
E/v4l2_utils( 75): Error = Invalid argument from qbuf
E/CameraHardwareSec( 75): ERR(int android::CameraHardwareSec::previewThread()):overlay queueBuffer fail
I/dalvikvm-heap(12597): Grow heap (frag case) to 21.133MB for 5760016-byte allocation
E/v4l2_utils( 75): Error = Invalid argument from qbuf
E/CameraHardwareSec( 75): ERR(int android::CameraHardwareSec::previewThread()):overlay queueBuffer fail

Memory error in Android after capturing images

In my Android application I'm trying to capture three images and upload this three images. I'm capturing two images one by one no problem but when I capture third images the application crashes with error:
09-26 16:17:31.398: ERROR/AndroidRuntime(24115): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
09-26 16:17:31.398: ERROR/AndroidRuntime(24115): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
09-26 16:17:31.398: ERROR/AndroidRuntime(24115): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:459)
09-26 16:17:31.398: ERROR/AndroidRuntime(24115): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:271)
09-26 16:17:31.398: ERROR/AndroidRuntime(24115): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:296)
How can I solve the error like this?

Categories

Resources