Bug 28023 - Error XA0000: Unexpected error - Reason: Out of memory (XA0000)
Summary: Error XA0000: Unexpected error - Reason: Out of memory (XA0000)
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.20.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-03-13 17:45 UTC by David Ortinau [MSFT]
Modified: 2015-04-25 00:44 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description David Ortinau [MSFT] 2015-03-13 17:45:40 UTC
After several successful build and deploys of an Android project, I'll get this error and need to restart Xamarin Studio (5.8, Build 443). This error has been around for a while.

/work/rendr/DirecTV/DirecTV/DirecTV.AndroidTablet: Error XA0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com. Reason: Out of memory (XA0000) (DirecTV.AndroidTablet)

I've increased my heap to 1G thinking I need more memory obviously. Perhaps I didn't do that effectively. There are a couple hundred MBs to this build with videos right now, and it's a slow slow build anyway.

=== Xamarin Studio ===

Version 5.8 (build 443)
Installation UUID: 89b6d01c-6671-4dc0-af25-78eba7a1514b
Runtime:
	Mono 3.12.1 ((detached/b7764aa)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010000

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.8.0.2 (Business Edition)
Hash: ccfcd59
Branch: 
Build date: 2015-03-10 02:20:32-0400

=== Xamarin.Android ===

Version: 4.20.0.37 (Business Edition)
Android SDK: /Users/dave/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Not Installed

=== Build Information ===

Release ID: 508000443
Git revision: 73883239470cbe8e261c94d95f7c3d0452fd393b
Build date: 2015-03-10 07:22:51-04
Xamarin addins: a2ff7b617f09d9c45d8bbf3d010b5db0d7d36100

=== Operating System ===

Mac OS X 10.10.2
Darwin RMBP-2.local 14.1.0 Darwin Kernel Version 14.1.0
    Mon Dec 22 23:10:38 PST 2014
    root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
Comment 1 James 2015-03-25 22:02:55 UTC
I have a project with 700M assets (build action is "AndroidAssets") and the java heep size in project build option is configured as 1G, I got exactly same error, but on Windows. Any workaround or suggestions?
Comment 2 Jonathan Pryor 2015-03-25 22:25:11 UTC
Please set or increase the $(JavaMaximumHeapSize) MSBuild property. There should be a way to set it from the Project Options/Properties dialog.

http://developer.xamarin.com/guides/android/under_the_hood/build_process/
Comment 3 James 2015-03-25 22:55:07 UTC
Jonathan, I already set the JavaMaximumHeapSize to be 1G in the .csproj file. Did you refer to this one? and what's the maximum value I can use for this?
Comment 4 James 2015-03-26 04:24:50 UTC
I found this thread and a link in this thread says that 64 bit Java may allow more heap size, how can I set Xamarin to use 64 bit Java to use more heap size over 1G?

http://forums.xamarin.com/discussion/2132/java-heap-space-outofmemoryerror-when-binding-a-big-jar
Comment 5 Jonathan Pryor 2015-03-26 11:58:51 UTC
@James: Yes, I'm referring to that one. I don't know what the maximum value is; increase until Java can't start. ;-)

...which is probably less than 2G for 32-bit systems.

As for using a 64-bit Java:

> Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

You're already using a 64-bit JVM.
Comment 6 David Ortinau [MSFT] 2015-04-25 00:44:25 UTC
At 2G heap I see this build fail after 10 or so build/deploys and have to restart XS.

I'm at 4G heap now and will see if that improves the situation.

I confirmed this issue on Windows with Visual Studio 2013. 

I realize from what I'm reading about this issue that this isn't necessarily a Xamarin issue per se, but if we could at least recover without requiring a XS restart, that would be wonderful.