Bug 23443 - Getting out of memory error
Summary: Getting out of memory error
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.18.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2014-09-28 19:33 UTC by Paul Johnson
Modified: 2014-10-08 10:22 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 INVALID

Description Paul Johnson 2014-09-28 19:33:22 UTC
I'm building a fairly large project. The build works fine, but before a binary is produced I'm getting

Target _CompileDex:
		  JavaSourceFiles:
		  JavaLibraries:
		  ExternalJavaLibraries:
		  LibraryProjectJars:
		    obj/Debug/__library_projects__/Microsoft.WindowsAzure.Messaging.Android/library_project_imports/WindowsAzure.Messaging.Jars.notification-hubs-0.3.jar
		  AdditionalJavaLibraryReferences:
		    /Volumes/New Developer/Developer/ftrack2/android-old/ftrack2/Components/googleplayservices-19.0.0/lib/android/19/content/google-play-services/libproject/google-play-services_lib/libs/google-play-services.jar
		    /Users/PFJ/.local/share/Xamarin/Android.Support.v4/20/content/support/v4/android-support-v4.jar
		    /Users/PFJ/.local/share/Xamarin/Android.Support.v7.AppCompat/20.0.0/content/support/v7/appcompat/libs/android-support-v7-appcompat.jar
		    /Users/PFJ/.local/share/Xamarin/Android.Support.v7.MediaRouter/19.1.0/content/support/v7/mediarouter/libs/android-support-v7-mediarouter.jar
		  DoNotPackageJavaLibraries:
		Tool /usr//bin/java execution started with arguments: -jar /Users/PFJ/Library/Developer/Xamarin/android-sdk-mac_x86/build-tools/20.0.0//lib/dx.jar --no-strict --dex --output=obj/Debug/android/bin/classes.dex obj/Debug/android/bin/classes /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v4.0.3/mono.android.jar "/Volumes/New Developer/Developer/ftrack2/android-old/ftrack2/ftrack2/obj/Debug/__library_projects__/Microsoft.WindowsAzure.Messaging.Android/library_project_imports/WindowsAzure.Messaging.Jars.notification-hubs-0.3.jar" "/Volumes/New Developer/Developer/ftrack2/android-old/ftrack2/Components/googleplayservices-19.0.0/lib/android/19/content/google-play-services/libproject/google-play-services_lib/libs/google-play-services.jar" /Users/PFJ/.local/share/Xamarin/Android.Support.v4/20/content/support/v4/android-support-v4.jar /Users/PFJ/.local/share/Xamarin/Android.Support.v7.AppCompat/20.0.0/content/support/v7/appcompat/libs/android-support-v7-appcompat.jar /Users/PFJ/.local/share/Xamarin/Android.Support.v7.MediaRouter/19.1.0/content/support/v7/mediarouter/libs/android-support-v7-mediarouter.jar 
		
		UNEXPECTED TOP-LEVEL ERROR:
		java.lang.OutOfMemoryError: Java heap space
			at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:338)
			at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:322)
			at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:259)
			at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:123)
			at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:69)
			at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:101)
			at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:72)
			at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:299)
			at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:139)
			at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:94)
			at com.android.dx.command.dexer.Main.processClass(Main.java:682)
			at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
			at com.android.dx.command.dexer.Main.access$600(Main.java:78)
			at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
			at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
			at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
			at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
			at com.android.dx.command.dexer.Main.processOne(Main.java:596)
			at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
			at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
			at com.android.dx.command.dexer.Main.run(Main.java:230)
			at com.android.dx.command.dexer.Main.main(Main.java:199)
			at com.android.dx.command.Main.main(Main.java:103)
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: error : Tool exited with code: 3. Output: 
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: Java heap space
	at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:338)
	at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:322)
	at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:259)
	at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:123)
	at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:69)
	at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:101)
	at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:72)
	at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:299)
	at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:139)
	at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:94)
	at com.android.dx.command.dexer.Main.processClass(Main.java:682)
	at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
	at com.android.dx.command.dexer.Main.access$600(Main.java:78)
	at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
	at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
	at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
	at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
	at com.android.dx.command.dexer.Main.processOne(Main.java:596)
	at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
	at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
	at com.android.dx.command.dexer.Main.run(Main.java:230)
	at com.android.dx.command.dexer.Main.main(Main.java:199)
	at com.android.dx.command.Main.main(Main.java:103)

	Task "CompileToDalvik" execution -- FAILED
	Done building target "_CompileDex" in project "/Volumes/New Developer/Developer/ftrack2/android-old/ftrack2/ftrack2/ftrack2.csproj".-- FAILED
	
Done building project "/Volumes/New Developer/Developer/ftrack2/android-old/ftrack2/ftrack2/ftrack2.csproj".-- FAILED

I've tried with the versions on alpha, beta and stable and still get this error

=== Xamarin Studio ===

Version 5.7 (build 248)
Installation UUID: f3d1a29c-1ba2-4a83-a193-1087efe91a85
Runtime:
	Mono 3.10.0 ((detached/ac51002)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000016

=== Apple Developer Tools ===

Xcode 6.0 (6299)
Build 6A313

=== Xamarin.Mac ===

Version: 1.11.0.1 (Enterprise Edition)

=== Xamarin.Android ===

Version: 4.16.0.17 (Enterprise Edition)
Android SDK: /Users/PFJ/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.0    (API level 11)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)

=== Xamarin.iOS ===

Version: 8.2.0.176 (Enterprise Edition)
Hash: 973f8d4
Branch: 
Build date: 2014-09-17 17:40:20-0400

=== Build Information ===

Release ID: 507000248
Git revision: ad2c21dd546d05bd4c90bf08ce5413a61e1813f0
Build date: 2014-09-25 17:42:58-04

=== Operating System ===

Mac OS X 10.10.0
Darwin Pauls-iMac.local 14.0.0 Darwin Kernel Version 14.0.0
    Sun Sep  7 19:47:26 PDT 2014
    root:xnu-2782.1.96~4/RELEASE_X86_64 x86_64
Comment 1 Arpit Jha 2014-09-29 04:17:34 UTC
I have checked this issue and unable to reproduce it.

I am able to build and deploy android application successfully.

Could you please provide us sample project and build info with environment detail ,So that I can able to reproduce at my end 

Screencast regarding same :
http://screencast.com/t/GdxPipezMahH
Environment Info :
=== Xamarin Studio ===

Version 5.4 (build 240)
Installation UUID: 45555ffd-f3f0-4f29-9543-e369d711ab7d
Runtime:
	Mono 3.10.0 ((detached/53e3161)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000018

=== Apple Developer Tools ===

Xcode 6.0.1 (6528)
Build 6A317

=== Xamarin.Mac ===

Version: 1.11.0.1 (Business Edition)

=== Xamarin.Android ===

Version: 4.16.0 (Business Edition)
Android SDK: /Users/xamarin77/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin.iOS ===

Version: 8.0.0.63 (Trial Edition)
Hash: 58b46df
Branch: 
Build date: 2014-09-18 22:32:07-0400

=== Build Information ===

Release ID: 504000240
Git revision: 01786bc67c7024ec33d327ed27e4416d7a846f4e
Build date: 2014-09-17 10:58:48-04
Xamarin addins: 7cd7dfcd6b7b7b53281508954ec080f1cd153ad3

=== Operating System ===

Mac OS X 10.9.5
Darwin Xamarin77s-Mac-mini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 4 Paul Johnson 2014-10-07 22:07:27 UTC
Got a bit more feedback
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOf(Arrays.java:2734)
	at java.util.ArrayList.ensureCapacity(ArrayList.java:167)
	at java.util.ArrayList.add(ArrayList.java:351)
	at com.android.dx.ssa.back.FirstFitLocalCombiningAllocator$1.processInsn(FirstFitLocalCombiningAllocator.java:674)
	at com.android.dx.ssa.back.FirstFitLocalCombiningAllocator$1.visitNonMoveInsn(FirstFitLocalCombiningAllocator.java:637)
	at com.android.dx.ssa.NormalSsaInsn.accept(NormalSsaInsn.java:206)
	at com.android.dx.ssa.SsaBasicBlock.forEachInsn(SsaBasicBlock.java:989)
	at com.android.dx.ssa.SsaMethod.forEachInsn(SsaMethod.java:728)
	at com.android.dx.ssa.back.FirstFitLocalCombiningAllocator.analyzeInstructions(FirstFitLocalCombiningAllocator.java:624)
	at com.android.dx.ssa.back.FirstFitLocalCombiningAllocator.allocateRegisters(FirstFitLocalCombiningAllocator.java:127)
	at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:104)
	at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:69)
	at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:101)
	at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:72)
	at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:299)
	at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:139)
	at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:94)
	at com.android.dx.command.dexer.Main.processClass(Main.java:682)
	at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
	at com.android.dx.command.dexer.Main.access$600(Main.java:78)
	at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
	at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
	at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
	at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
	at com.android.dx.command.dexer.Main.processOne(Main.java:596)
	at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
	at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
	at com.android.dx.command.dexer.Main.run(Main.java:230)
	at com.android.dx.command.dexer.Main.main(Main.java:199)
	at com.android.dx.command.Main.main(Main.java:103)

=== Xamarin Studio ===

Version 5.5 (build 227)
Installation UUID: f3d1a29c-1ba2-4a83-a193-1087efe91a85
Runtime:
	Mono 3.10.0 ((detached/633e444)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000020

=== Apple Developer Tools ===

Xcode 6.1 (6539)
Build 6A1046a

=== Xamarin.iOS ===

Version: 8.2.0.193 (Business Edition)
Hash: 959c1e4
Branch: 
Build date: 2014-10-03 00:25:37-0400

=== Xamarin.Android ===

Version: 4.17.0 (Business Edition)
Android SDK: /Users/PFJ/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.0    (API level 11)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: /usr
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

=== Xamarin.Mac ===

Version: 1.11.0.1 (Business Edition)

=== Build Information ===

Release ID: 505000227
Git revision: 7b721eeec7a2fa4c4f4de0ecd2aed4dc25edac95
Build date: 2014-10-02 15:53:38-04
Xamarin addins: 99ed56b428b31eba1efaace4d82188d6f334e6ca

=== Operating System ===

Mac OS X 10.10.0
Darwin Pauls-iMac.local 14.0.0 Darwin Kernel Version 14.0.0
    Sat Sep 27 03:58:47 PDT 2014
    root:xnu-2782.1.97~11/RELEASE_X86_64 x86_64
Comment 5 Arpit Jha 2014-10-08 10:07:37 UTC
I have checked this issue and unable to reproduce it.
I tried to reproduce with the help of comment 2 and 3 and observed that getting application Crash after Launch.
 
Device : Samsung Galaxy S4
Application Output : https://gist.github.com/AkhileshKumar01/01f901c9bd4240d01c88
Build Output :    https://gist.github.com/AkhileshKumar01/d008fa31704b0a9c3093
adb Logcat :  https://gist.github.com/AkhileshKumar01/bb79fe05c6831237a970

Let me know if I missed anything to reproduce it.

Environment Info:
=== Xamarin Studio ===

Version 5.5 (build 227)
Installation UUID: 3dbf10c4-ed30-4e55-8a8b-1704777c7b5f
Runtime:
 Mono 3.10.0 ((detached/633e444)
 GTK+ 2.24.23 (Raleigh theme)

 Package version: 310000020

=== Xamarin.Android ===

Version: 4.18.0 (Trial Edition)
Android SDK: /Users/apprpject/Desktop/android-sdk-macosx
 Supported Android versions:
  2.1    (API level 7)
  2.2    (API level 8)
  2.3    (API level 10)
  3.1    (API level 12)
  3.2    (API level 13)
  4.0    (API level 14)
  4.0.3  (API level 15)
  4.1    (API level 16)
  4.2    (API level 17)
  4.3    (API level 18)
  4.4    (API level 19)
  4.4.87 (API level 20)
  4.5    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.iOS ===

Version: 8.2.0.193 (Starter Edition)
Hash: 959c1e4
Branch: 
Build date: 2014-10-03 00:25:37-0400

=== Xamarin.Mac ===

Version: 1.10.0.18 (Starter Edition)

=== Build Information ===

Release ID: 505000227
Git revision: 7b721eeec7a2fa4c4f4de0ecd2aed4dc25edac95
Build date: 2014-10-02 15:53:38-04
Xamarin addins: 99ed56b428b31eba1efaace4d82188d6f334e6ca

=== Operating System ===

Mac OS X 10.8.5
Darwin localhost 12.5.0 Darwin Kernel Version 12.5.0
    Sun Sep 29 13:33:47 PDT 2013
    root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64
Comment 6 Paul Johnson 2014-10-08 10:22:37 UTC
It seems to be an issue that the stack is running out of memory which can be fixed though the project settings, though it did take some searching to find an answer. Closing the bug.