“Error occurred during initialization of VM; Could not reserve enough space for object heap” using -Xmx3G
Could it be that you’re using a 32-bit jvm on that machine?
Could it be that you’re using a 32-bit jvm on that machine?
If you used Aptitude (apt-get) to install Jenkins on Ubuntu 12.04, uncomment the JAVA_ARGS line in the top few lines of /etc/default/jenkins: # arguments to pass to java #JAVA_ARGS=”-Xmx256m” # <–default value JAVA_ARGS=”-Xmx2048m” #JAVA_ARGS=”-Djava.net.preferIPv4Stack=true” # make jenkins listen on IPv4 address
At startup pass this -Dname=value and then in your code you should use value=System.getProperty(“name”); to get that value
Update This answer is relevant for Java 5-7, Java 8 has this fixed: https://blogs.oracle.com/poonam/about-g1-garbage-collector,-permanent-generation-and-metaspace Kudos go to mt.uulu For Java 5-7: The standard Oracle/Sun VM look on the world is: Classes are forever. So once loaded, they stay in memory even if no one cares anymore. This usually is no problem since you don’t have … Read more
You have pretty much nailed it except that these options are picked up even if you start JVM in-process via a library call. The fact that _JAVA_OPTIONS is not documented suggests that it is not recommended to use this variable, and I’ve actually seen people abuse it by setting it in their ~/.bashrc. However, if … Read more
The permanent space is where the classes, methods, internalized strings, and similar objects used by the VM are stored and never deallocated (hence the name). This Oracle article succinctly presents the working and parameterization of the HotSpot GC and advises you to augment this space if you load many classes (this is typically the case … Read more
Current version: Help | Change Memory Settings: Since IntelliJ IDEA 15.0.4 you can also use: Help | Edit Custom VM Options…: This will automatically create a copy of the .vmoptions file in the config folder and open a dialog to edit it. Older versions: IntelliJ IDEA 12 is a signed application, therefore changing options in … Read more