Reputation: 2799
I'm on the home stretch of this App I'm working on and I can't seem to get it to port to iOS. When trying to build my application on iOS, I get an OutOfMemory exception over and over again.
Then I tried to build a basic Gluon Mobile application and port it to iOS and I get this:
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:createDefaultIOSLauncher UP-TO-DATE
:compileIosJava UP-TO-DATE
:processIosResources UP-TO-DATE
:iosClasses UP-TO-DATE
:iosExtractNativeLibs UP-TO-DATE
:createIpa
RoboVM has detected that you are running on a slow HDD. Please consider mounting a RAM disk.
To create a 2GB RAM disk, run this in your terminal:
SIZE=2048 ; diskutil erasevolume HFS+ 'RoboVM RAM Disk' `hdiutil attach -nomount ram://$((SIZE * 2048))`
See http://docs.robovm.com/ for more info
RoboVM has detected that you are running on a slow HDD. Please consider mounting a RAM disk.
To create a 2GB RAM disk, run this in your terminal:
SIZE=2048 ; diskutil erasevolume HFS+ 'RoboVM RAM Disk' `hdiutil attach -nomount ram://$((SIZE * 2048))`
See http://docs.robovm.com/ for more info
Root pattern javax.annotations.**.* matches no classes
Root pattern javax.inject.**.* matches no classes
RoboVM has detected that you are running on a slow HDD. Please consider mounting a RAM disk.
To create a 2GB RAM disk, run this in your terminal:
SIZE=2048 ; diskutil erasevolume HFS+ 'RoboVM RAM Disk' `hdiutil attach -nomount ram://$((SIZE * 2048))`
See http://docs.robovm.com/ for more info
Root pattern javax.annotations.**.* matches no classes
Root pattern javax.inject.**.* matches no classes
Warning: javax.xml.bind.annotation.XmlRootElement is a phantom class!
Warning: java.nio.file.StandardOpenOption is a phantom class!
Warning: java.nio.file.FileSystem is a phantom class!
Warning: java.nio.file.OpenOption is a phantom class!
Warning: java.nio.file.FileSystems is a phantom class!
Warning: com.oracle.jrockit.jfr.TimedEvent is a phantom class!
Warning: com.oracle.jrockit.jfr.EventToken is a phantom class!
Warning: com.oracle.jrockit.jfr.ValueDefinition is a phantom class!
Warning: com.oracle.jrockit.jfr.EventDefinition is a phantom class!
Warning: com.oracle.jrockit.jfr.Producer is a phantom class!
Warning: com.oracle.jrockit.jfr.FlightRecorder is a phantom class!
Daemon stopping because JVM tenured space is exhausted
Daemon stopping because JVM tenured space is exhausted
My IMac is running 8GB of RAM on a 2.7GHz I5.
I have also attempted mounting a RoboVM RAM Disk to no success. Please help!
Upvotes: 0
Views: 341
Reputation: 45476
Usually, the iOS deployment requires a lot of memory, and it is a good practice to increase by default the maximum allocation memory pool of the JVM heap, up until 2 GB.
Running from your IDE, you can set this default value in the Gradle preferences.
For instance, on NetBeans, go to Preferences->Miscellaneous->Gradle, Scripts & Tasks, and as Gradle JVM arguments add -Xmx2048m
:
Another option is to set a gradle property in your gradle.properties
file (the one with the ANDROID_HOME property, under <user>/.gradle
):
org.gradle.jvmargs=-Xmx2048m
This property file will be applied either running from IDE or from command line, so it is more appropriate.
A typical situation where an out of memory error is found is the first time the RoboVM compiler is launched. Luckily, all the compiled classes are cached, so restarting the task just resumes the process.
Also, if the process fails, sometimes can be convenient to stop all the deamon threads with gradle --stop
and ./gradlew --stop
, and start the task again.
If the process ends successfully, even if there are warning messages, just check on your iOS device that the app was installed and runs fine. Note that you could find memory issues as well, but this is a different issue.
Edit
when running long tasks, it's always convenient using --info
to find out more about the process, with a more verbose output.
Also, the process can be run from the console (from NetBeans, right click on the build.gradle file and select Tools->Open in Terminal).
Upvotes: 1