Today, when I was running a project with IntelliJ IDEA, I found some solutions online and recorded them for reference.
Modify the configuration file
IntelliJ IDEA\bin
-server -Xverify:none -Xms300M -Xmx512M -XX:+UseParNewGC -XX:PermSize=128m -ea
-server Use server jvm. As appropriate, some docs say IDEA adds this option to increase speed.
-Xverify:none Turns off Java bytecode verification, which speeds up class loading and allows classes to be loaded without loading during startup only for verification purposes, shortening startup time.
-Xms: is another parameter that sets memory. It is used to set the size of the memory stack when the program is initialized. If this value is increased, the startup performance of your program will be improved. However, there are also previous restrictions and xmx restrictions.
-Xmx: is an option in java, which is used to set the maximum memory that your application can use (optimistically, causing your application to not the entire jvm). If your program needs to spend a lot of memory, you need to modify the default settings. For example, when configuring tomcat, if the traffic and programs are very large, you need to increase this value. However, one thing you need to remember is not to exceed the memory of your machine, as your machine will not be able to stand it and will die at that time. .
-XX: PermSize The size of the permanent zone.
-XX:+UseParNewGC uses parallel collection algorithm.
If the memory is large, you can change the file to:
-Xms256m
-Xmx384m
-XX:MaxPermSize=128m
-XX:NewRatio=4
-Xss128k
-=true
-server
There are also some configurations that can be modified, such as setting the buffer to other disks outside the C disk.
Other influencing factors
In addition to the memory allocation to idea startup, there are also:
1. Is your C drive idle enough? Because idea will create a cache in your user directory on your C drive. If your C disk space is small, it will be more tiring to run.
2. Is your project bloated? Because the default idea will treat all files as project files, but in fact, what we need to edit in idea is basically program files. Class files, jar files, doc files, etc. are not needed. Open the module setting interface, switch to the source option to exclude all those that do not belong to the program file, greatly reducing the load of ideas.
3. If the project path contains Chinese, it will greatly increase the running time.
The above solution to the slow running of IntelliJ IDEA is all the content I share with you. I hope you can give you a reference and I hope you can support me more.