Grails default memory settings in IntelliJ - java

I am using Grails 2.5.1 and Java 8 with IntelliJ 14.1.4. Whenever I run any grails command (eg: clean) using the Grails Run Target (Ctrl+Alt+g), IntelliJ executes the below command:
C:\iDocs\Programs\Java\jdk1.8.0_60\bin\java -Dgrails.home=C:\iDocs\Programs\grails-2.5.1 -Dbase.dir=C:\iDocs\xxxx -Dtools.jar=C:\iDocs\Programs\Java\jdk1.8.0_60\lib\tools.jar -Dgroovy.starter.conf=C:\iDocs\Programs\grails-2.5.1/conf/groovy-starter.conf -Xmx768M -Xms768M -XX:MaxPermSize=256m -XX:PermSize=256m -Djline.WindowsTerminal.directConsole=false -Dfile.encoding=windows-1252 -classpath C:\iDocs\Programs\grails-2.5.1\lib\org.codehaus.groovy\groovy-all\jars\groovy-all-2.4.4.jar;C:\iDocs\Programs\grails-2.5.1\dist\grails-bootstrap-2.5.1.jar org.codehaus.groovy.grails.cli.support.GrailsStarter --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf C:\iDocs\Programs\grails-2.5.1/conf/groovy-starter.conf "clean -plain-output"
Can anyone give me the location for this VM configuration (highlighted above) that I can edit, especially the PermSize and MaxPermSize?
UPDATE:
Note:
a) Adding it to VM options on Run Target window doesnt modify it.
b) Adding it to the VM options of IntelliJ executeable (idea64.exe.vmoptions) also doesnt work.

Go to (IntelliJ installation bin directory):
<Installation Dir>/JetBrains/IntelliJ IDEA <version>/bin
Modify:
idea.exe.vmoptions
idea64.exe.vmoption
This is in context to a windows setup. You can find the corresponding in OSX.
UPDATE:
For Grails application, setting up GRAILS_OPTS as environment variables is also an option.

I contacted the IntelliJ support and unfortunately, it is not supported by the IDE. An issue has been created to track the same:
https://youtrack.jetbrains.com/issue/IDEA-145433
If anyone is facing the same issue, please upvote the issue created (IDEA-145433) and comment in there.

Related

How to run Eclipse memory analyzer on Mac os?

I have some issues with running Eclipse memory analyzer on my laptop.
This happen when i have just downloaded(from the place) and executed application:
And i can't figure out what is the cause of problem. Can someone help me???
Move mat.app to ./Applications solve my problems
This is a bug, you can run command:
1. cd mat.app/Contents/MacOS
2. ./MemoryAnalyzer
It looks like a permission problem with the default directory.
From this discussion : Memory Analyzer ยป Setting up workspace directory?.
It is indicated that you should edit your MemoryAnalyzer.ini file, and add those lines (on two separate lines, and before the vm arguments), replacing the second with the path where you want the MemoryAnalyzer to write its content:
-data
<desired path of your working directory>
Find the MemoryAnalyzer.ini file .
Add the following content:
-vm
<your Java1.7 path>
Does the latest Eclipse Memory Analyzer snapshot build work better for you? This is a signed and notarized dmg not a zip so might be easier to install.
I was having issue running MAT(Eclipse memory analyzer) on Mac. So I have tried installing "Eclipse Memory Analyzer" plugin in Sts that I use, it worked.
You can also install MAT as plugin in Eclipse/STS that you use already.
One more solution is to
open mat.app --args -data ~/<your-folder>

Start Eclipse on MacOS from Java Command line

I'm working with an older version of Eclipse, Helios SR1.
I need to be able to start eclipse from the terminal.
In review of http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F
I execute the following command in Terminal to start eclipse.
/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -jar plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
and I get
Root exception: java.lang.NoClassDefFoundError:
org/eclipse/swt/SWTError
So this appears to be more complex than what was found in the above link. If I double-click the Eclipse.app it starts right up.
I'm wondering what else needs to be done to allow the Command Line Eclipse Launcher to work properly
You should just be able to use the open command:
open /path/to/eclipse.app
or
open -n /path/to/eclipse.app
will open a new instance of Eclipse even if one is already running.
If you must use the Java command you need to specify -XstartOnFirstThread before the -jar option:
java -XstartOnFirstThread -jar ...
Use the eclipse launcher binary:
<Your-Install-Path>/Eclipse.app/Contents/MacOS/eclipse
Default start-up options are set in eclipse.ini:
<Your-Install-Path>/Eclipse.app/Contents/Eclipse/eclipse.ini
Kepler start-up options are documented here: https://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html (Helios link redirects to Kepler, the oldest one they have kept available)
The launching process is explained in detail here: https://help.eclipse.org/2019-03/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/launcher.html

Intellij IDEA won't start

When I open Intellij 14 , it starts the initial loading and then following is shown in the screen.After that it is vanished and program does not start.
But when I open the task manager it is shown in the Processes as per the below figure.
Sometimes the program starts after about 10 minutes .Sometimes it won't start at all.Can someone give me a solution on how to overcome this problem ?
Just like Tom, I too have increased the memory when IntelliJ asked and regretted it. This is the screen that asked for it:
However, in my case, instead of editing the .vmoptions files in the bin folder, IntelliJ created a new one in my home directory which I can only assume overrides the ones in the bin folder. I would assume this is typical of the new versions - I am using IntelliJ 2016.1 right now.
So, in order to fix this issue, go to C:\Users\<your_username>\.IntelliJIdea<version>\config (or your OS' equivalent) and delete the idea.exe.vmoptions and/or idea64.exe.vmoptions file from there. This should remove the override and have IntelliJ use the settings in the bin folder.
It might be worth checking the files in the bin folder as well, in case IntelliJ changes how it handles these settings.
Here are the default .vmoptions files in the installation's bin folder; you can't delete these as it will prevent IntelliJ from starting:
bin/idea.exe.vmoptions:
-server
-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=150m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
bin/idea64.exe.vmoptions
-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=225m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
I got an out-of-memory dialog on intellij 15 and took an option on that dialog to increase max memory. Thereafter I could not start intellij. So, I looked in the intellij /bin folder for a pid file (per another stack overflow question) to see what was happening, but I could not find one. There was however a file (idea.exe.vmoptions) that had changed (to hold my new memory setting). So I edited that file to set max memory back to what I had before, and now it works.
You can try to open Intellij on CLI.
cd C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\bin
later then execute this command
idea.bat
Probably Intellij will open. If it will not open then you can see the error message why it will not open on CLI.
Just updated IntelliJ to a newer version, and I followed the 'configure' link to double the memory used for IntelliJ which I later regret. IntelliJ could not restart. Open the system.log (e.g. Use CMD+SPACE_BAR and search 'console' on MacOs, then go to system.log), I can see IntelliJ aborted a few times with an abnormal code 1. Here the lines related to the launch,
Processing VMOptions file at
/Users/[user]/Library/Preferences/IntelliJIdea2019.2/idea.vmoptions
com.apple.xpc.launchd[1] (com.jetbrains.intellij.22016[2971]): Service exited with abnormal code: 1
I can see the path from where IntelliJ loads vm options during the launch.
Checking the bin/ of my IntelliJ application, I can see another version of the idea.vmoptions file that has a slightly older timestamp. By comparing the content of the two files, I now realized that IntelliJ created another vm option file that has only a sub set of options in a newer location which broke the restart. Deleting or just safely renaming the newer file in the [User] sub directory fixed my problem.
C:\Users\<user>\AppData\Roaming\JetBrains\
if you are a Windows user, remove this directory. It helped me
Edit C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.6\bin\idea.exe.vmoptions the Xmx to Xmx512
-server
-Xms128m
-Xmx512m
Following steps helped me to overcome the Java heap size related issues on InteliJ IDEA.
Go to the location where you have installed the IDEA IDE and search for the following file:
idea64.exe.vmoptions
Change it accordingly.
-Xms4196m
-Xmx8092m
-XX:MaxPermSize=1000m
-XX:ReservedCodeCacheSize=1024m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
Also be aware of the 32-bit address space limit on Windows which makes it hard to use heap sizes higher than 750m. Should you need to use larger heap, make sure to switch to the 64-bit JVM first, otherwise IDE may crash on start or start to crash randomly during work.
For me, the cause was a bad plugin.
I moved all plugins in below directory to a backup directory, and started IDEA, and it started without an issue.
C:\Users\<username>\AppData\Roaming\JetBrains\IntelliJIdea2021.2\plugins
Then, copied plugins back to the above directory one by one, to identify the broken plugin.
You might also check your IDEA_JDK_64, JAVA_HOME and JDK_HOME environmental variables. In my case I updated Java version and deleted previous directory containing JDK. Then IntelliJ started to dissapear from processes just a few seconds after launch. I changed all paths to point proper JDK directory and then it started to work as it should.
Check the logs for error or issue in the path C:\Users\.IntelliJIdea14\system\log\idea.log.
If that report HeapDumpOnOutOfMemoryError
Go to VM options files in the path C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.6\bin
Increase the -Xms750m to greater value say -Xms900m .
That solve the issue for me
Had a similar issue.
idea64.exe just didn't start silently.
idea.bat printed just IDE is being shut down and didn't start either.
In my case there was no effect of manipulations with idea64.exe.vmoptions, but it helped to find and kill from Task Manager an invisible orphan idea64.exe process.
This solution was hinted by the first comment by #CrazyCoder at https://intellij-support.jetbrains.com/hc/en-us/community/posts/360009511720--Solved-Idea-Community-doesn-t-start-after-update-to-2020-1-4.

Eclipse error 'g++/gcc' not found in path

I have installed Eclipse 4.3 Juno. My environment is split into two separate workspaces. One is for Java and one for c/c++.
When I run the eclipse for C I can work with it and compile my projects.
eclipse -data d:\src\c -vmargs -Xmx512M
Now when I run the environment for Java development I suddenly get this error:
error 'g++/gcc' not found in path
The two workspaces are completely separated with their own .metadata directories.
I tried various hints that I found here and via google, like resetting the preferences, but nothing helped. Since I can work with my C environment it should be proof enough that the compiler exists. :) It is also in the PATH variable, so when I use g++/gcc on the windows commandproampt I get access denied (because it's cygwin).
So How can I get rid of this annoying error when I run my eclipse only for Java. I don't even need CDT there, but the plugins are probably installed in eclipse and not in the workspace. So this has to be some path setting or so, which I changed for the C but not for the Java environment.
So finally I found a solution. I got the hint from here Configure Eclipse CDT to use g++
The important bit was the comment that g++ is a symbolic link. Everything was set up ok, but when I executed g++ or gcc from the windows command prompt, I got the error "Access denied" while it worked from within cygwin.
After reading the bit about it being a symbolic link, it was clear what the problam was, because Windows can not cope with it. So what I did now, I reversed the symbolic links such that gcc and g++ is the real exe and the links of g++-3 and so on are pointing now to the exe, instead of the other way around.
I had to restart eclipse using the -clean option, then restarted it normaly and the error is history. :D
You should install the build-essential
sudo apt-get install build-essential
after installing this, open a terminal, and type g++ (hit enter) if it says there is no input, then you got your g++
I mean, eclipse is good but problems like this are persistent I find.
Try giving NetBeans a look in.

How to set eclipse console locale/language

When developing web application with Eclipse (Helios) the tomcat output is being sent to the console. Ok, but the messages are being translated to my OS language.
In fact, my Eclipse is in English, but the Tomcat output (logging) is being translated to Portuguese. Probably it's a Tomcat configuration issue, but I can't find where...
How do I change this behaviour? I want my entire Eclipse in English, including Tomcat.
Go to Window > Preferences > Java > Installed JREs > select preferred JRE > Edit and then add the following to Default VM arguments:
-Duser.language=en -Duser.country=US
Try adding -Duser.language=en in the bottom of your eclipse.ini which is found in your eclipse installation directory (keep a backup copy of the eclipse.ini before any changes).
Have you tried setting the following -D parameters in the launch configuration?
-Duser.language=en -Duser.country=US -Duser.variant=EN
As #Rich and other answers said above::
You can add -Duser.language=en -Duser.country=US to the Run Configuration > VM arg for a specific java file.

Categories

Resources