IntelliJ IDEA is too slow during run or debug [duplicate] - java

How can I make IDEA to run faster in Ubuntu? I am running it in a i7 thinkpad with 6 gigs of RAM.

Disable all unused plugins for example Struts 2, Subversion Integration, UI Designer if you don't have deal with them.
Also increase memory heap, for that I suggest you check following links:
Tuning IntelliJ IDEA
JetBrains' new intelliJ IDEA 13 slow?

help -> edit custom vm options -> change everything to:
--server
-Xms1024m
-Xmx1024m
-Xmn256m
-XX:MetaspaceSize=256m
-XX:ReservedCodeCacheSize=2g
-XX:SoftRefLRUPolicyMSPerMB=50
-Xverify:none
-XX:PermSize=128m
-XX:+UseCompressedOops
-XX:+UseG1GC
-XX:+UseNUMA
-XX:MaxMetaspaceSize=1024m
-XX:CICompilerCount=2
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-XX:CICompilerCount=2
-ea
-Dsun.io.useCanonPrefixCache=false
-Dkotlinx.coroutines.debug=off
-Djdk.module.illegalAccess.silent=true
-Dide.no.platform.update=true
-Djdk.attach.allowAttachSelf=true
-Dsun.io.useCanonCaches=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djdk.attach.allowAttachSelf=true
-Djdk.module.illegalAccess.silent=true
-Dkotlinx.coroutines.debug=off
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof

Related

Intellij JBoss - Initial heap size set to a larger value than the maximum heap size

I am using IntelliJ 2020.1 Ultimate and have a JBoss 7.0.2 server that I want to run from IntelliJ.
I have added it as a configuration:
But when I try start the server, I get the following error:
IDEA.app/Contents/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/Kotlin/lib/kotlin-stdlib.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/Kotlin/lib/kotlin-reflect.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/Kotlin/lib/kotlin-plugin.jar"
org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 64088
4a7ed3b5-cfb6-4196-b997-396c16d8c06f
/Users/richardmarais/Library/Caches/JetBrains/IntelliJIdea2020.1/compile-server
Picked up JAVA_TOOL_OPTIONS: -Dhttps.protocols=TLSv1.2 -Xmx2048m
-XX:MaxPermSize=1024m -Xms2048m OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0 Error occurred
during initialization of VM Initial heap size set to a larger value
than the maximum heap size
My idea.vmoptions are the default values:
-Xms128m
-Xmx2048m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Djdk.attach.allowAttachSelf=true
-Dkotlinx.coroutines.debug=off
-Djdk.module.illegalAccess.silent=true
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof
Question
Do you know how I can fix the above error to get JBoss to start?
You don't need to set any global environment variables to patch the VM options.
Unset JAVA_TOOL_OPTIONS and specify the proper VM Options in the Run/Debug configuration for the server:
-Xms256m -Xmx2048m -XX:MaxPermSize=512m
It should be more than enough for any project. I doubt that you really need 5GB initial heap size.
Also note that IntelliJ IDEA .vmoptions doesn't affect the options for the apps that you start from the IDE.
I fixed this by doing this.
open -a TextEdit.app ~/.bash_profile
then:
export JAVA_TOOL_OPTIONS="-Dhttps.protocols=TLSv1.2 -Xmx4096m -Xms128m"

JVM 11 flag PrintHeapAtGC not recognized by Amazon's Corretto JVM 11

Ran into this, the weird thing is, I can't find any pages about it. Searching for "PrintHeapAtGC not recognized" on google results in nothing helpful. In fact, it results in thread talking about how people are using it in JVM 11 with no problem.
I've printed the flags I use one per line, perhaps it's because of some combination I don't know is even a combination?
How do I even check that?
Can someone have a look at this and tell me what's wrong?
-XX:+ExitOnOutOfMemoryError
-XX:NewRatio=3
-XX:SurvivorRatio=4
-XX:TargetSurvivorRatio=90
-XX:MaxTenuringThreshold=8
-XX:+UseParallelGC
-XX:ParallelGCThreads=4
-XX:+CMSScavengeBeforeRemark
-XX:PretenureSizeThreshold=64m
-XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSInitiatingOccupancyFraction=50
-XX:CMSMaxAbortablePrecleanTime=6000
-XX:+CMSParallelRemarkEnabled
-XX:+ParallelRefProcEnabled
-XX:-OmitStackTraceInFastThrow -verbose:gc
-XX:+PrintHeapAtGC
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-XX:+PrintTenuringDistribution
-XX:+PrintGCApplicationStoppedTime -Xloggc:/tmp/gc.log
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=9
-XX:GCLogFileSize=20M
-XX:+PrintFlagsFinal
-XX:+PrintFlagsWithComments -version
There is no more -XX:+PrintHeapAtGC and some other Print options since JDK 9.
The -XX logging flags were replaced with Unified JVM Logging mechanism.
New equivalent for PrintHeapAtGC is -Xlog:gc+heap=debug

JDK 1.8 not working with IntelliJ IDEA 15.0.2 "Error: Abnormal build process termination"

I know I am probably the nth person asking this question, but I have been trying to hunt down a solution for this by looking at other answers for the past couple of days but I am still stuck.
Whenever I try to use JDK 1.8 with IntelliJ IDEA 15.0.2, I get the following error when I try to run my program:
Error: Abnormal build process termination:
Error occurred during initialization of VM
Could not reserve enough space for 716800KB object heap
I have tried to change the vmoptions, but I still do not have any luck with this. Here are the values I currently have for my vmoptions:
idea.exe.vmoptions
-server
-Xms512m
-Xmx1028m
-XX:MaxPermSize=1028m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
idea64.exe.vmoptions
-Xms1028m
-Xmx2048m
-XX:MaxPermSize=1028m -Xmx2048m
-XX:ReservedCodeCacheSize=1028m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
Any solutions to resolve this?
Came to a solution by changing the vm options to the following:
idea.exe.vmoptions
-server
-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
idea64.exe.vmoptions
-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
I had exactly the same issue. After I added:
-Xmx256m
to 'VM options', it started to work.
I had the same problem because of the
-server
option included in my idea64.exe.vmoptions.
Try to remove it and restart your IDE

How to speed up IntelliJ on Mac OS X 10.9

I'm using Mac OSX 10.9 and Intellij Idea 13 on a decked out machine (7i processor, 16GB RAM, 64 bit, etc.). I have things working well; however, it seems to me that Intellij is running pretty slow (approx. 5 mins to boot up, almost a full 2 minutes to compile a system out print line class, etc.). As a frame of reference I have looked through numerous posts and have landed on the configurations below. My question is this. Does anyone else use a similar set up and have it running quicker? If so, what modifications have you made to your environment to speed things up. Thanks in advance for any help.
Java Version:
Switched from jdk1.6 to jdk1.7
idea.vmoptions:
-ea
-server
-Xms1g
-Xmx1g
-Xss16m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
-XX:+UnlockExperimentalVMOptions
-XX:+UseConcMarkSweepGC
-XX:LargePageSizeInBytes=256m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
-XX:ParallelGCThreads=8
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:+DisableExplicitGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+PrintGCDetails
-XX:+PrintFlagsFinal
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:CMSInitiatingOccupancyFraction=60
-XX:+CMSClassUnloadingEnabled
-XX:+CMSParallelRemarkEnabled
-XX:+UseAdaptiveGCBoundary
-XX:+UseSplitVerifier
-XX:CompileThreshold=10000
-XX:+UseCompressedStrings
-XX:+OptimizeStringConcat
-XX:+UseStringCache
-XX:+UseFastAccessorMethods
-XX:+UnlockDiagnosticVMOptions
info.plist (modification):
<key>LSArchitecturePriority</key>
<array>
<string>x86_64</string>
</array>
<key>JVMVersion</key>
<string>1.7*</string>
I strongly suggest you not to use all these VM options (especially those controlling garbage collector) unless you actually measure they will improve performance.
Please report reproducable performance problems as described here https://intellij-support.jetbrains.com/entries/29983118-Reporting-performance-problems
Here's the scoop. There is a lot of stuff out there about changing the heap size, garbage collectors and what not. It may not be the root cause of your problem. Be sure to understand what you are setting in your vmoptions file as several suggestions aren't really supported any longer. I worked with the folks at IntelliJ going back and forth with log files and what not and it boils down to this. Check your anti virus. After adjusting my anti-virus, the following settings have IntelliJ screaming. Please note that this was the cause to my individual problem; so be sure to check your log files because that is where I started to find answers.
JDK 1.6
.vmoptions is running in the /Application/IntelliJ13/bin:
-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCompressedOops
*notice that you don't need to allocate huge amounts of system resources. If you set up your system correctly it isn't needed.
Idea.plist:
<key>LSArchitecturePriority</key>
<array>
<string>x86_64</string>
<string>i386</string>
</array>
<key>JVMVersion</key>
<string>1.6*</string>
I know it is simple but it works.

Keep jRuby.jar in memory

I'm wrote simple jRuby scriptlets support in my tomcat 7 java application. If I invoke page, that using jRuby first time, it loads about 3-7 seconds. Next time it loads faster. But, after some time jRuby unloading from memory, and after request I'm again wait 3-7 seconds.
Does exists any methods to always keep jRuby in memory withouth unloading?
PS. Current tomcat run options:
-Xmx2048M -Xms2048M -XX:ParallelGCThreads=8 -Xincgc -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:+AggressiveOpts -XX:+CMSParallelRemarkEnabled -XX:+DisableExplicitGC -XX:MaxGCPauseMillis=500 -XX:SurvivorRatio=16 -XX:TargetSurvivorRatio=90 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -Xnoclassgc -XX:UseSSE=3 -XX:PermSize=512m -XX:LargePageSizeInBytes=4m
I'm using Oracle java 6u26.

Categories