IntelliJ set heap size over 4GB. How to? - java

I'm using IntelliJ 14.3 on x64 Java. Available memory: 10Gb (out of 16Gb total RAM)
(Basically set -Xmx8000M or greater)
The problem is I need more than 4Gb memory to use for an App.
I can not find any answer or solution to my problem and I've looked for days.
I've been looking on stackoverflow for people asking the same question, but they had problems with the default value -Xmx512M and they kept linking to other answers, linking to another answer (waste of time and no solution so far).
I tried the following things that did not work:
Modifying the idea64.exe.vmoptions file for IntelliJ: didn't seem to do anything, no error, no memory increase, nothing. (it seemed as it ignored the file)
Using JAVA_OPTIONS in Environment Variables: Made IntelliJ crash on startup or freeze without using more memory than before.
Tried it with a lower value, of 1512M, same heap size problem
A fresh installation, even of the 15.x version of IntelliJ: nothing changed.
*Note:
someone at my workplace can set it in IntelliJ to work (but we can't figure out how
Running the class in command line with that -Xmx8000M seems to work, but I want to set it in IntelliJ for easy use
If anyone ran into this issue and can suggest solutions, I politely ask them to do so.

What worked for me was the following:
Help -> Edit Custom VM Options, change to -Xmx8000M
restart IntelliJ
Run -> Edit Configurations -> Application -> your main class -> Configuration,
add -Xmx8000M in the VM Options field.
Doing only 1) or 3) but not both didn't work for me.

Adding -Xmx10000M option to the bellow location worked for me:
"Intellinj Idea -> Run -> Edit Configuration -> Modify Options -> Add VM Option"

To specify the memory used by the app, specify the needed -Xmx option in the "VM options" field of the run configuration you use to start the app from IntelliJ IDEA.

Related

Java Mission Control No JVMs detected Windows 10

I just downloaded Java Mission Control (JMC) for the first time and upon starting JMC, the following popup appears:
I am trying to go through the Q&A but I am either not sure how to implement the suggested solutions, or the solutions don't seem to work, which I detail below:
My attempted solutions
Referring to the suggested solutions enumerated above:
A1: I am not running in Eclipse (I am running the JMC app directly as an executable), and anyway what does it mean to "run an app on a JDK, not a JRE"?
A2: Indeed the hsperfdata folder was not writeable, so I modified the folder to give all permissions to everyone and closed all Java apps:
However, after starting a new Java app, the permissions revert back to their original settings and thus I am unable to implement this suggested solution:
A3: The line after -vm is not empty, so I don't think this suggested solution is relevant for me:
For what it's worth, both JConsole and JVisualVM are able to find all running Java processes:
In case it is helpful for others with the same issue, I was able to resolve the problem described above by adding the location of the JRE contained within the JDK to the front of the System PATH variable (Windows 10):

Why ECLIPSE NEON is so slow on ubuntu 16.04?

I'm using the eclipse neon IDE and I put it on the path: /opt/eclipse/eclipse and i am using Ubuntu 16.04 and Java 8. The problem is that when I write in the eclipse editor, this is going too slow. For example, I just typed and in the editor it still does not end.
How can I solve it?
Thx!
Try Netbeans, or IntelliJ IDEA.
A quick browse over the Interwebs shows that quite a lot of people are complaining about Eclipse slowness. Some have every manner of trick and configuration change to help speed it up. OK, you can put yourself thru all that hassle if you want, or, you can just switch to something that already works fine out of the box.
I had Eclipse Oxygen for PHP running on a CentOS 7 VM with 2G allocated RAM. I admit, that's pretty low memory, but that's the way it has to be right now. Eclipse ran so slowly, I finally gave up and killed the process from the command line.
I installed the latest Netbeans 8.2, and it not only installed more cleanly (no Java error messages, and it put an icon on the desktop), it ran PERFECTLY without changing a thing!
I eventually changed a couple of parameters, but the point is, I didn't need to change a thing to get decent performance. Even on a low-ram system, it ran plenty fast enough.
Don't blame the hardware. Not everybody has the money to buy the latest and greatest and fastest machines available, and software developers should not expect it. With some exceptions, if your application can not run adequately on 2G of ram, you are doing something wrong.
The Eclipse developers are doing something terribly wrong.
I had faced a similar issue with eclipse oxygen.
After a some research over different forums I found the following solution.
Step 1 : Open eclipse.ini file. If you find difficulty in locating the file, see this question Where's the location of the eclipse.ini file?
Step 2 : In eclipse.ini search for below 2 variables
-Xms
-Xmx
Xms indicates minimum ram that should be allocated to eclipse.
Xmx indicates maximum ram that should be allocated to eclipse.
Step 3 :Increment both the values. You can set the value as per your choice. Below is my preference.
-Xms512m
-Xmx2048m
Here
m indicates megabytes, if you don't specify m it will consider bytes by default.
The easiest thing to do would be to re-install eclipse, and if that does not work you could try to download an older version of eclipse. It could also be slow because your computer is slow.

java.lang.OutOfMemoryError: Java heap space in IntelliJ

I have imported a SBT project into IntelliJ(version 14). When I am trying to run something in the terminal, the console output is giving me "java.lang.OutOfMemoryError: Java heap space".
I have tried increasing the size (Xms2048m, Xmx2048m) in *.vmoptions, and also in the IDE build settings of SBT project. I have restarted my machine as well. Nothing is working out.
Any more inputs on it other than the things I have tried ?
P.S: I am running the project through the activator. When I am doing it from IntelliJ command prompt it's throwing me the error, but when I run the activator from windows command prompt, it is successfully running the application.
You just asked your IDE:
-Xms2048m - ask VM to allocate 2048MB (2GB) heap on start
-Xmx2048m - limit heap to 2048MB
The reason could be:
You tried to exceed 2048MB
Allocating 2048MB on start was not possible (you probably just went out of RAM)
System thought so fast allocation was a malware.
I think you will need to provide the memory settings as parameters to the command you are running on the console.
To the best of my knowledge any parameters set inside IntelliJ will only be for use of IntelliJ itself, and when you run the project from the SBT window (I am assuming it works like the maven window).
Also as far as I know the terminal window in IntelliJ is just a "pass through" to the underlying console of the host system.
Not sure you need it, but this seems to be a good explanation of the memory settings, and links to duplicate answers: What are the Xms and Xmx parameters when starting JVMs?
I was getting a similar issue while building the project in IntelliJ what worked for me is to update the build memory size in settings as below:
Settings (or Preferences) -> Build, Execution, Deployment -> Compiler -> Shared build process heap size (Mbytes)

Jvm error -6 while starting Intellij-IDEA in 64 bit

I have a problem starting Intellij IDEA (15.0.3) in 64 bit mode. When clicking on the idea6.exe I get this error (Failed to create a JVM error code -6):
This is my configuration:
System:
Windows 7 - 64 bit - 16GB RAM
System Variables:
IDEA_JDK_64: C:\Program Files\Java\jdk1.8.0_74
JVM_HOME: C:\Program Files\Java\jdk1.7.0_79
(1.7 version is needed for my dev activity)
vm options: idea64.exe.vmoptions left as default
As a trial: I've tried various combinations like system variables pointing to the same JDK path or also to increase -Xmx value in idea64.exe.vmoptions, but the error is still there.
What can the root cause be?
Thank you very much.
I solved problem in my case by deleting file C:\Users\username\.IdeaIC2016.2\idea.exe.vmoptions, because I created it before to customize VM options. File can have name idea64.exe.vmoptions if you overrode options under 64-bit version of Intellij IDEA.
Tracked it down to a mis-typed VM option in the end.
Somehow one of the lines in my idea64.exe.vmoptions file has been mis-typed. Instead of -XX:UseParNewGC I had -XX:USeParNewGC (note the unwanted extra capital letter).
Correcting that fixed the problem - so check your .vmoptions file for typos if you get the -6 error on startup.
And note that there may be several copies of this file. The default is in the installation folder (eg "Program Files (x86)\Jetbrains\Intellij 2016.1\bin\idea64exe.vmoptions"), but if you select "Help...Edit Custom VM Options" in the IDE it will create an override file in \Users\.IntellijIdea2016.1\idea64exe.vmoptions
I experienced the same issue with IntelliJ IDEA 2016.1.3 on 64bit Windows 7 with JDK1.8.0_92.
Executing idea.bat instead of idea.exe worked for me.
I think issue caused because you are using 32 bit launcher, and it has limitation as 4G for RAM.
So, if you will change value "-Xmx" to 2048 in c:\users\XXXXXX.WebStorm2016.3\webstorm.exe file -> this should help. Otherwise -> delete this file and wait when WebSrotm propose you to change it from IDE
Note: there are also webstorm.exe and webstorm64.exe files in your c:\Program Files
Had same problem, any option in studio64.exe.vmoptions led to this window.
Fixed by changing entry in PATH, it had old JDK folder, which pointed to different Java installation(Java 7) than JAVA_HOME(Java 8), after replacing it — Android Studio started normally with entries in studio64.exe.vmoptions file.
For me, using Intelli J Idea Community Version 2017.3, I found the idea.exe.vmoptions file in C:\Users\${UserName}.IdeaIC2017.3\config. I had increased the JVM Heap Memory to 4096MB from 512MB due to an earlier crash (-Xmx4096m). Changing to 1024MB seemed to do the job.
For me it worked once i deleted the vmoptions file created under the C:USERS.IntelliJIdea2017.2\config folder.

Eclipse won't start

when trying to start eclipse, i receive the message in the image.
when trying to start other instance of eclipse, i receive a message saying: "failed to create the java virtual machine".
How can i solve it?
try starting eclipse with -clean option
./eclipse -clean
If it still doesn't start check ".log" file for error. This file should be located in "workspace/.metadata" folder. Publish error from log to your question.
Also check Java version and JAVA_HOME and PATH on your system are set accordingly. Java version should be at least 1.5
The message "failed to create the java virtual machine" usually implies the failure to allocate enough memory for starting the JVM. This is often due to unavailability of sufficient contiguous free memory in RAM, or incorrect min and max heap sizes.
From the screenshot, it appears that the problem might not be with the min and max heap sizes, so you might want to take a look at the amount of free memory available when starting Eclipse (although that is no indicator of whether all free memory is contiguous).
To begin fixing this issue, you could start Eclipse from the command-line and observe the error messages reported if any. Then you could proceed to calibrate the JVM settings that are better suited to your installation (heavy plugins will require more memory), or change to another JVM.
See also
Why does Eclipse crash with Xmx, XX:MaxPermSize above certain values?
What are the best JVM settings for Eclipse?
Go to C:\Program Files\Java\jre6\bin\client\ and make sure that jvm.dll exists there.
Either way, you might want to try re-installing or updating Java on your machine.
To modify file eclipse/eclipse.ini, try a smaller number in attribute -Xmx, and restart.
Check your version of Java. Oracle accidentally broke Eclipse when they updated the vendor field from 'Sun Microsystems' to 'Oracle'.
http://insideria.com/2010/08/oracle-breaks-eclipse-and-flex.html
Oracle was nice enough to change it back and release an update, which fixes Eclipse.
I had a similar problem when I installed JDK 64-bit version with an install of Eclipse 32-bit (didn't realize it until much searching and searching). Simple solution, but a shot none-the-less.

Categories

Resources