I'm developing an intellij plugin and when i'm trying to run the plugin (or debug it) i keep getting the following error:
Could not create the Java virtual machine. Invalid initial heap size:
-Xms128m
The JVM parameters in the Run\Debug configurations are (by default):
-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-ea
-Dsun.io.useCanonCaches=false
So eventually I can't debug or run my code.
JVM is unhappy because there are newline characters between options.
You can confirm this by copy-pasting VM Options into a text editor.
I met the same problem today. I solved this problem by making the checked and select the IDEA Plugin Sdk。My Idea version is 11.1.5. you can try it..
Related
I have followed the instructions for getting started with codenameone in IntelliJ, yet when I set up my first project, based on the sample app I get this error:
"C:\Program Files\Java\jdk-15.0.1\bin\java.exe" -Xms128m -Xmx1014m -XX:ReservedCodeCacheSize=512m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:CICompilerCount=2 -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -ea -Dsun.io.useCanonCaches=false -Djdk.http.auth.tunneling.disabledSchemes=\"\" -Djdk.attach.allowAttachSelf=true -Djdk.module.illegalAccess.silent=true -Dkotlinx.coroutines.debug=off "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.1\lib\idea_rt.jar=61544:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Users\reinp\OneDrive - beuthhs\beuth\Patterns und Frameworks\justtrivia\out\production\justtrivia;C:\Users\reinp\OneDrive - beuthhs\beuth\Patterns und Frameworks\justtrivia\src;C:\Users\reinp\OneDrive - beuthhs\beuth\Patterns und Frameworks\justtrivia\lib\CodenameOne.jar;C:\Users\reinp\OneDrive - beuthhs\beuth\Patterns und Frameworks\justtrivia\JavaSE.jar;native\internal_tmp;lib\impl\cls" com.codename1.impl.javase.Simulator com.patrickreinbold.justtrivia.JustTrivia
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Process finished with exit code 1
I saw that this has to do with Java 8 but in the IntelliJ instructions it says nothing about using Java 8. Is Java 8 always necessary or can codenameone run with Java 15, too?
EDIT:
I have now got it to open by simply copying the first line with the java command and removing the UseConcMarkSweepGC flag, then running it in terminal. But I am still not sure if that is "the correct way" to do it or if something could break along the way now.
Ignore unsupported VM options with another option:
-XX:+IgnoreUnrecognizedVMOptions
This is a problem with the netbeans build script but this isn't really relevant as Codename One only supports Java 8 and Java 11 (at this time) so you should use one of those versions at the moment.
run export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
Homebrew users:
Comment out these lines
# /usr/local/etc/elasticsearch/jvm.options
## GC configuration
#-XX:+UseConcMarkSweepGC
#-XX:CMSInitiatingOccupancyFraction=75
#-XX:+UseCMSInitiatingOccupancyOnly
Then if you get
Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m'
Update the logging file path
# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m
to
# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=/usr/local/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m
Sources
Brew installed Elasticsearch 7.9.2 failing on macOS
https://stackoverflow.com/a/57993824/2237510
I ram running into issue where my application throws PermGen size error whenever I generate cobertura report using this command clean cobertura:cobertura. I have the tried almost everything such as the following:
Increase permgen size in sts.ini
Increase permgen size in jdk vm argumemts by going into Windows -> Preferences
-> Java -> Installed JREs -> click jdk -> edit and on the vm args
Increase permgen size in maven.bat file
Some in stackOverFlow recommended to mention the version in surefire plugin and I have that in place already
None of the above is helping me at all. I am using Mock/PowerMock objects a lot in my JUnit test cases. Maven test runs perfectly fine.
How can I fix this issue?
Thanks
Since you tried to change sts.ini, I'm assuming you are running it from inside STS. Even when Maven is kicked off by STS, it runs in a separate process from STS, so changing sts.ini wouldn't help. you need to set the MAVEN_OPTS with the increased permgen size in the run configuration for the mvn job.
set MAVEN_OPTS.
Value will be: -Xms1024m -Xmx3000m -XX:MaxPermSize=1024m
export MAVEN_OPTS="-Xms1024m -Xmx3000m -XX:MaxPermSize=1024m" //unix
set MAVEN_OPTS="-Xms1024m -Xmx3000m -XX:MaxPermSize=1024m" //window
I have some memory issues while using the IntelliJ IDEA 13.1 (currently 13.1.6), due to insufficient amount of RAM. I work on a quite big project and often run some maven builds as well as a web application in debug mode. I've got a 32-bit OS (Windows 7), 3 GB RAM and an SSD. I use the JDK 7.
The Maven builds which are run inside of IntelliJ IDEA fail often due to insufficient memory and I have to resume them from the point of failure.
An alert "Your computer is low on memory" is shown by the Windows system often when I perform the Maven builds or try to start the web application using IntelliJ IDEA.
I use the following settings in the configuration file "idea.exe.vmoptions" (located in the same directory as the "idea.exe" file):
-server
-Xms128m
-Xmx700m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=64m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseCodeCacheFlushing
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
The MAVEN_OPTS environment variable is set to the following value:
-Xmx1024m -Dfile.encoding=UTF8
I already disabled unused plugins and found out that it's useful to restart the IDEA after memory-consuming operations, like e.g. after a Maven build. I also found out that closing as much other applications as possible helps a bit, but not always.
However, all aforementioned tricks didn't eliminate the problems.
What are your recommendations, apart from extending the RAM or changing to a 64-bit OS?
Do you know some better settings for the "idea.exe.vmoptions" file?
I was trying to make a Minecraft server and got the following error on startup:
Error occured 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.
I tried everything I could find: I created CLASS and CLASSPATH environmental variables that went to my Java's bin folder. I re-installed java, making sure it was 64 bit, as my computer is. Still, I get this error. Does anyone know a solution?
You are attempting to allocate more RAM than your system will allow you to allocate.
In your startup script, lower the values of your Xmx/Xms arguments.
Run the JVM with -XX:MaxHeapSize=256m (or any big number), and possibly -Xmx512m
I've actually noticed this issue when you try and take a dump of a service running java.
Try using psexec -s to execute your dump
I'm not sure why this seems to work on some servers and not others
I had this same error. Running the cmd as Administrator resolved it.
I encountered this error when I was trying to build selenium webdriver. as suggested above by Rogue that we need to reduce the allocated memory in the arguments.
I changed java heap size arguments as below
java $JAVA_OPTS -Xmx256m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=256m -jar third_party/jruby/jruby-complete.jar -X-C -S rake $*
I also faced this issue by My IntellijIDEA allocate more jvm memory space than system allocated.
My issued is resolved through just uninstall the JDK and install it again.
It happened to me also. My eclipse would not run. Uninstalled and reinstalled eclipse like 3 time and no luck. Came to this question during a google search, and Yasir's answer helped me out, because I also had IntelliJ installed into my DEV BOX recently. So deleted C:\Program Files\Java folder and reinstalled java into default install folder and it worked. I also had jdk in my system path from previous setup.
My issue was resolved after I reinstalled latest version of JDK.
I just upgraded to IntelliJ IDEA 12.0 and get an error immediately upon attempting to launch:
The JVM could not be started. The maximum heap size (-Xmx) might be too large or
an antivirus or firewall tool could block the execution.
I checked my idea.exe.vmoptions file and the maximum heap size is only 640m (I have 8 GB physical memory and am not running any other applications).
idea.exe.vmoptions
-Xms128m
-Xmx640m
-XX:MaxPermSize=640m
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-ea
-Dsun.io.useCanonCaches=false
I still have IntelliJ IDEA 11.4 on my machine and I am able to run that (using the same values for max heapsize in idea.exe.vmoptions). Since IntelliJ IDEA 11.4 runs, I don't believe it is an antivirus or firewall issue. I have also checked those settings as well.
Anyone run across this or have any idea (no pun intended)?
Please see this answer for the problem background and the solution.
Your questions seems to be the exact duplicate of:
How to increase intellij 32bit xmx more than 1GB?
Assuming you are on windows I am curious why you are running the 32bit version of intellij when you have a 64bit machine?
I was having the same error and found that there was two things going on. The first was that the link I had in the taskbar was pointing to the idea.exe instead of the idea64.exe, which meant I was only launching the 32bit version of intelliJ.
Second there is another file for vm options for the 64bit. idea64.exe.vmoptions
After switching to the 64bit exe and making sure the vm options I wanted were correct in the vmoptions file I did not have any further issues.
On another interesting note I found that on 32bit machines when the 32bit version of intelliJ was set to have 1gb of memory for -Xmx and I had chrome open I would get the error. If I closed chrome I would no longer get the error. I think this had something to do with the jvm verifying that the required amount of memory was available before launching.
Try to configure your idea to the default values
-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-ea
-Dsun.io.useCanonCaches=false
VM options are loaded from the IDE_HOME\bin\[bits][.exe].vmoptions file.
More info: https://intellij-support.jetbrains.com/entries/23393413-The-JVM-could-not-be-started-The-main-method-may-have-thrown-an-exception
I found that switching from a 32-bit version to a 64-bit version caused the issue, as my windows shortcuts still pointed to the old idea.exe and not the correct idea64.exe.