issue in Attempting to fetch sbt - java

i am student and i am try to install apache spark on Ubuntu when ever i try to
built spark through sbt with sbt/sbt assembly command i find this error
i have already try to maximize the size of the heap still have not found
solution to this issue kindly help me through this issue.
the error i found
Attempting to fetch sbt
Launching sbt from build/sbt-launch-0.13.7.jar
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Check out this article:
http://viralpatel.net/blogs/jvm-java-increase-heap-size-setting-heap-size-jvm-heap/
Sometimes when you attempt builds and you don't have enough heap allocated it will bomb out, hence, in the example they increase heap size on the command line before running HelloWorld:
java -Xms64m -Xmx256m HelloWorld

Related

Error running Java application as SYSTEM using SCCM

I'm attempting to run a Desktop installer using Microsoft's SCCM. The installer was written using NSIS which predominantly executes Java calls. This works great unless it's run as the SYSTEM profile using SCCM. All Java calls look like this:
java -jar -Xms512m -Djna.nosys=true myapp.jar [options] ...
✅ When this application is run as a standard user, it works just fine.
⛔️ When this application is run as SYSTEM, it does not work.
Debugging this application we've found the following error is thrown:
Error occurred during initialization of VM
Unable to allocate 60928KB bitmaps for parallel garbage collection for the requested 1949696KB heap.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I've tried using the recommendations from this Harvard article, but then I get a new error.
java -jar -Xms512m -Djna.nosys=true -XX:+UseSerialGC -XX:ActiveProcessorCount=1 myapp.jar
# ^--- NEW ^--- NEW
The new error:
Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
Java HotSpException in thread "main" ot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
CodeCache: size=245760Kb used=3192Kb max_used=3192Kb free=242567Kb
bounds [0x00000295494c0000, 0x00000295497e0000, 0x00000295584c0000]
total_blobs=1238 nmethods=897 adapters=254
compilation: disabled (not enough contiguous free space left)
java.lang.OutOfMemoryError: Metaspace
Why won't Java run properly as SYSTEM using SCCM?
As a (non comprehensive) stop-gap solution, removing -Xms512m fixes the issue with SCCM. Fortunately the installer doesn't require as much memory as requested.

Error: could not create the Java Virtual Machine Can't allocate enough memory to Minecraft server

I have currently been trying to setup a minecraft server on an Intel Nuc that I have it has 8gb of ram this will be important later. I used to be running it on my main desktop and was able to tun it with 4gb of ram allocated to it, that computer had 16gb of ram though. My initial problem was that I could not allocated more than 1500M of ram to it using the following command in a .bat file;
java -Xms2048M -Xmx2048M -jar server.jar
I then decided to run it in command prompt and received the following error.
java -Xmx2048M -Xms2048M -jar server.jar nogui
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
I did some research on the error and found that I might need to add a system variable for.
Variable name: _JAVA_OPTIONS
Variable value: -Xmx512M
So I did that and it still didn't work.
Then I decided to install 64bit Java as I did not know if I had it or not and that is when I received the error;
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
So after that i tried to figure out which version I had so I ran the command;
java -version
and received this:
Picked up _JAVA_OPTIONS: -xms512M
Unrecognized option: -xms512M
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Whenever I try to run any Java commands or the server this is what I get and this is after I had removed the system variable.
I am not super knowledgeable about Java and I am just trying to run a minecraft server so if you need any more information please ask.
Thanks for all of the feedback but I got it working it turns out I just needed to restart a few times and uninstall the version of Java I had and get 64-bit Java. Also if your still curious I am running windows on the NUC

Memory issue while building spark

I have installed Scala, sbt and hadoop 1.0.3 over Ubuntu 12.o4 client OS. With the reference of link - http://docs.sigmoidanalytics.com/index.php/How_to_Install_Spark_on_Ubuntu-12.04, I tried building Spark and got error related to reserve space.
Here is what I am trying to run:
hduser#vignesh-desktop:/usr/local/spark-1.1.0$ SPARK_HADOOP_VERSION=1.1.0 sbt/sbt assembly
Output with following error:
Using /usr/lib/jvm/java-6-openjdk-i386/ as default JAVA_HOME.
Note, this will be overridden by -java-home if it is set.
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
I get this solved by passing mem attribute with sbt command as given below, (for 4 GB RAM system)
SPARK_HADOOP_VERSION=1.1.0 sbt/sbt assembly -mem 1024

How to resolve error with Android Studio

I am using Windows 7 x32bit and Android Studio v0.8.6 and after installation I got some error with gradle .
Error:Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at
http://gradle.org/docs/1.12/userguide/gradle_daemon.html
Please read below process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Reducing android studio memory usage: https://code.google.com/p/android/issues/detail?id=82894#c3
Edit studio.exe.vmoptions or studio64.exe.vmoptions in your android studio installation directory, and edit the Xms, Xmx, MaxPermSize options.
Reducing gradle memory usage: https://code.google.com/p/android/issues/detail?id=82894#c1
set vmoptions for gradle in gradle.properties file. I set Xmx to 256m
and MaxPermSize to 128m.
However, this will probably slow down your android studio and/or gradle build process. If you can do it, upgrade your memory to 8 GB AND upgrade your OS to 64-bit.

Eclipse Gradle STS Extension: Could not reserve enough space for object heap

Once in a while I'll get the following error when the Gradle STS extension tries to execute my project's gradle build script after launching Eclipse 3.7 (Indigo) with the Gradle STS extension installed,
Unable to start the daemon process. The exit value was: 1.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/current/userguide/gradle_daemon.html
Please read below process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Could not fetch model of type 'EclipseProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.0-bin.zip'.
And here are my system specs:
Windows 7 32-bit
Eclipse 3.7 32-bit
Java jdk1.7.0_07 32-bit
Is this a known bug with this plugin? Any idea on how to fix it?
In eclipse, go to Window, Preferences, Gradle, Arguments
and add the gradle jvmargs -Xms128m -Xmx512m in the dialog:
Sounds like once in a while, your system can't reserve enough memory to start the Gradle daemon. Does the project have a gradle.properties containing memory settings (org.gradle.jvmargs)? Or, do you have a gradle.properties in ~/.gradle?
I had same problem with Gradle projects importing. (Windows 7 64-bit, sts-3.2.0.RELEASE 32bit, Java jdk1.7.0_13 32-bit).
Solved creating gradle.properties file in project directory(=sts workspace) with content: org.gradle.jvmargs=-Xms128m -Xmx512m.
Note that -Xmx=512m is max size of JVM memory I can use on my system. Bigger Xmx memory sizes leads to described error.

Categories