Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Java Out Of Memory Error related with bitmap

$
0
0

hi

i set heap size 1g but i got this :

[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Java.Lang.OutOfMemoryError: Exception of type 'Java.Lang.OutOfMemoryError' was thrown.
[MonoDroid]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
[MonoDroid]   at Android.Runtime.JNIEnv.CallStaticObjectMethod (IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue[] parms) [0x00000] in <filename unknown>:0 
[MonoDroid]   at Android.Graphics.BitmapFactory.DecodeResource (Android.Content.Res.Resources res, Int32 id) [0x00000] in <filename unknown>:0 
[MonoDroid]   at Android.Graphics.BitmapFactory+<DecodeResourceAsync>c__AnonStorey6.<>m__0 () [0x00000] in <filename unknown>:0 
[MonoDroid]   at System.Threading.Tasks.TaskActionInvoker+FuncInvoke`1[Android.Graphics.Bitmap].Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0 
[MonoDroid]   at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0 
[MonoDroid]   at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0 
[MonoDroid] --- End of stack trace from previous location where exception was thrown ---
[MonoDroid]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
[MonoDroid]   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[Android.Graphics.Bitmap].GetResult () [0x00000] in <filename unknown>:0 
[MonoDroid]   at Xamarin.Forms.Platform.Android.FileImageSourceHandler+<LoadImageAsync>d__0.MoveNext () [0x00000] in <filename unknown>:0 
[MonoDroid] --- End of stack trace from previous location where exception was thrown ---
[MonoDroid]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
[MonoDroid]   at System.Runtime.CompilerServices.TaskAwaiter`1[Android.Graphics.Bitmap].GetResult () [0x00000] in <filename unknown>:0 
[MonoDroid]   at Xamarin.Forms.Platform.Android.ImageRenderer+<UpdateBitmap>d__0.MoveNext () [0x00000] in <filename unknown>:0 
[MonoDroid]   --- End of managed exception stack trace ---
[MonoDroid] java.lang.OutOfMemoryError: (Heap Size=8076KB, Allocated=3473KB)
[MonoDroid]     at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
[MonoDroid]     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:707)
[MonoDroid]     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:537)
[MonoDroid]     at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:565)
[MonoDroid]     at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:595)
[MonoDroid]     at dalvik.system.NativeStart.run(Native Method)
[mono] 
[mono] Unhandled Exception:
[mono] Java.Lang.OutOfMemoryError: Exception of type 'Java.Lang.OutOfMemoryError' was thrown.
[mono]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
[mono]   at Android.Runtime.JNIEnv.CallStaticObjectMethod (IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue[] parms) [0x00000] in <filename unknown>:0 
[mono]   at Android.Graphics.BitmapFactory.DecodeResource (Android.Content.Res.Resources res, Int32 id) [0x00000] in <filename unknown>:0 
[mono]   at Android.Graphics.BitmapFactory+<DecodeResourceAsync>c__AnonStorey6.<>m__0 () [0x00000] in <filename unknown>:0 
[mono]   at System.Threading.Tasks.TaskActionInvoker+FuncInvoke`1[Android.Graphics.Bitmap].Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0 
[mono]   at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0 
[mono]   at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0 
[mono] --- End of stack trace from previous location where exception was thrown ---
[mono]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
[mono]   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[Android.Graphics.Bitmap].GetResult () [0x00000] in <filename unknown>:0 
[mono]   at Xamarin.Forms.Platform.Android.FileImageSourceHandler+<LoadImageAsync>d__0.MoveNext () [0x00000] in <filename unknown>:0 
[mono] --- End of stack trace from previous location where exception was thrown ---
[mono]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
[mono]   at System.Runtime.CompilerServices.TaskAwaiter`1[Android.Graphics.Bitmap].GetResult () [0x00000] in <filename unknown>:0 
[mono]   at Xamarin.Forms.Platform.Android.ImageRenderer+<UpdateBitmap>d__0.MoveNext () [0x00000] in <filename unknown>:0 
[mono]   --- End of managed exception stack trace ---
[mono] java.lang.OutOfMemoryError: (Heap Size=8076KB, Allocated=3473KB)
[mono]  at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
[mono]  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:707)
[mono]  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:537)
[mono]  at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:565)
[mono]  at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:595)
[mono]  at dalvik.system.NativeStart.run(Native Method)
[mono] 
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.OutOfMemoryError: Exception of type 'Java.Lang.OutOfMemoryError' was thrown.
[mono-rt]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
[mono-rt]   at Android.Runtime.JNIEnv.CallStaticObjectMethod (IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue[] parms) [0x00000] in <filename unknown>:0 
[mono-rt]   at Android.Graphics.BitmapFactory.DecodeResource (Android.Content.Res.Resources res, Int32 id) [0x00000] in <filename unknown>:0 
[mono-rt]   at Android.Graphics.BitmapFactory+<DecodeResourceAsync>c__AnonStorey6.<>m__0 () [0x00000] in <filename unknown>:0 
[mono-rt]   at System.Threading.Tasks.TaskActionInvoker+FuncInvoke`1[Android.Graphics.Bitmap].Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0 
[mono-rt]   at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0 
[mono-rt]   at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0 
[mono-rt] --- End of stack trace from previous location where exception was thrown ---
[mono-rt]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
[mono-rt]   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[Android.Graphics.Bitmap].GetResult () [0x00000] in <filename unknown>:0 
[mono-rt]   at Xamarin.Forms.Platform.Android.FileImageSourceHandler+<LoadImageAsync>d__0.MoveNext () [0x00000] in <filename unknown>:0 
[mono-rt] --- End of stack trace from previous location where exception was thrown ---
[mono-rt]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
[mono-rt]   at System.Runtime.CompilerServices.TaskAwaiter`1[Android.Graphics.Bitmap].GetResult () [0x00000] in <filename unknown>:0 
[mono-rt]   at Xamarin.Forms.Platform.Android.ImageRenderer+<UpdateBitmap>d__0.MoveNext () [0x00000] in <filename unknown>:0 
[mono-rt]   --- End of managed exception stack trace ---
[mono-rt] java.lang.OutOfMemoryError: (Heap Size=8076KB, Allocated=3473KB)
[mono-rt]   at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
[mono-rt]   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:707)
[mono-rt]   at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:537)
[mono-rt]   at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:565)
[mono-rt]   at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:595)
[mono-rt]   at dalvik.system.NativeStart.run(Native Method)
[mono-rt]

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>