Speedup IntelliJ-Idea

前端 未结 12 1736
轮回少年
轮回少年 2020-12-22 15:06

I\'m using intelliJ for Scala development and got 8 GB of new RAM last week, so I thought: time to use it. I checked my task manager and found intelliJ using ~2

相关标签:
12条回答
  • 2020-12-22 15:32

    The answer provided by adben is very helpful for improving the performance in my machine. Though I slightly overrided it after reading a Dzone article,

    -server
    -Xms2g
    -Xmx2g
    -XX:NewRatio=3
    -Xss16m
    -XX:+UseConcMarkSweepGC
    -XX:+CMSParallelRemarkEnabled
    -XX:ConcGCThreads=4
    -XX:ReservedCodeCacheSize=240m
    -XX:+AlwaysPreTouch
    -XX:+TieredCompilation
    -XX:+UseCompressedOops
    -XX:SoftRefLRUPolicyMSPerMB=50
    -Dsun.io.useCanonCaches=false
    -Djava.net.preferIPv4Stack=true
    -Djsse.enableSNIExtension=false
    -ea
    

    They improved the performance of large projects by using the above configuration and works flawlessly for our projects too. Lastly, I disabled all the plugins I won't use and that improves the things as well.

    Reference: https://dzone.com/articles/the-one-and-only-reason-to-customize-intellij-idea

    0 讨论(0)
  • 2020-12-22 15:33

    I've done some experimenting, and found that to decrease GC pauses the following combination works best: -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50.

    I'd also not make the heap too large, 512 or even smaller is OK for me. Otherwise when it becomes full the GC will have to walk it all which takes some time.

    0 讨论(0)
  • 2020-12-22 15:33

    I used this combination and it's working fine in my environment

    -server
    -Xms2048m
    -Xmx2048m
    -XX:NewSize=512m
    -XX:MaxNewSize=512m
    -XX:PermSize=512m
    -XX:MaxPermSize=512m
    -XX:+UseParNewGC
    -XX:ParallelGCThreads=4
    -XX:MaxTenuringThreshold=1
    -XX:SurvivorRatio=8
    -XX:+UseCodeCacheFlushing
    -XX:+UseConcMarkSweepGC
    -XX:+AggressiveOpts
    -XX:+CMSClassUnloadingEnabled
    -XX:+CMSIncrementalMode
    -XX:+CMSIncrementalPacing
    -XX:+CMSParallelRemarkEnabled
    -XX:CMSInitiatingOccupancyFraction=65
    -XX:+CMSScavengeBeforeRemark
    -XX:+UseCMSInitiatingOccupancyOnly
    -XX:ReservedCodeCacheSize=64m
    -XX:-TraceClassUnloading
    -ea
    -Dsun.io.useCanonCaches=false
    
    0 讨论(0)
  • 2020-12-22 15:35

    You can use the intellij's optimizer plugin:

    https://zeroturnaround.com/free/optimizer-for-intellij-idea/

    With the plugin you can:

    • Automatic tune virtual machine options
    • Disable class verification
    • Clean up system caches
    • Configure external build tools
    • Validate the latest Oracle JDK
    • Skip build and redeploy
    0 讨论(0)
  • 2020-12-22 15:38

    For me switching to SSD-drive improved performance a lot (especially for large projects).

    0 讨论(0)
  • 2020-12-22 15:38

    The most useful thing you can do for IntelliJ is to have a lot of free memory for disk caching. IntelliJ saves alot of its processing work in cached files. This works well if you have plenty of free memory, but if your disk cache is limited, you will see regular, long lasting pauses.

    I would suggest -XX:+UseConcMarkSweepGC rather than G1.

    I also work local copies of files to minimise file access delay.

    BTW: For the project I am on, I noticed the difference between working on a machine with 24 GB and one with 48 GB, even though the max heap is set to 2 GB ;)

    0 讨论(0)
提交回复
热议问题