We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to resolve out of memory exception when loading large images in Android?

Platform: Xamarin.Forms |
Control: SfImageEditor

When you try to load large size images in image editor in Android, you may get out of memory exception because this application cannot handle large size images. You can resolve this exception by using the following two ways:


Methods to resolve out of memory exception


1. Set largeHeap value as true in Android project.

2. Set largeHeap size for application.


How to set largeHeap value as true in Android project?


Code Snippet


To set largeHeap  value as true in Android project, refer the following code snippet.



To set largeHeap value as true, refer the following steps:

Step 1: Expand properties tab in Android project.




Step 2: In AndroidManifest.xml file, set largeHeap value as true. Please refer the following screenshot for better understanding.




How to set largeHeap size in application?


To set largeHeap size in application, follow the below steps:

Step 1: Right-click the Android project, and then select Properties.












Step 2: In Android options, select Advance and set Java Max Heap size as 1G.




2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile