IntelliJ IDEA write code to solve the case Caton Mac environment, IntelliJ IDEA modify memory size

Transfer: https://blog.csdn.net/it_0417/article/details/82759103

First, find the application to find IDEA Show Package Contents Contents ---> bin ---> idea.vmoptions ---> double click to open

Before you modify the contents inside should be like this (this picture from the network)

Description:
  1.Xms128m-- minimum memory
  2.Xmx750m-- maximum memory
  3. The reservation code cache size
  4.UseConcMarkSweepGC-- provided on behalf of the elderly concurrent collection

Why is there when using the Caton, heat from the computer, or even a fan whirring reason is very clear. The default value is set too small, the IDEA ran slightly larger items will bear. OK, now that we found the problem, the greater will be the default setting for the better do, of course, it is not right!

The modified configuration as follows:

-Xms1024m
-Xmx2048m
-XX:ReservedCodeCacheSize=1024m
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Xverify:none
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof

本人电脑内存有限,再加上电脑比较老,所以更改的也不是很大,配置好的可以改得更大一些。至于为啥设置2个g最大,因为我看了一篇文章,他做过测试,设置的再大就是浪费,但是系统默认的750m太小,项目大的话,分分钟就GG,这就跟jvm的内存设置似的,太大的话也不好,太小的话也不好。找个平衡的设置,是不错的。

 

OK。设置完成后我们保存一下当然是要重启IntelliJ IDEA了~~

Guess you like

Origin blog.csdn.net/Dongguabai/article/details/90269673