Extremely slow in autocompletion & code analysis for Kotlin projects in Intellij IDEA

前端 未结 4 1960
花落未央
花落未央 2021-02-07 07:14

We have a project on IDEA that consists of a couple med sized Java packages and one very small Kotlin package (5 files). I noticed performance is fine with any Java packages, bu

相关标签:
4条回答
  • 2021-02-07 07:38

    The problem visible in your snapshot is resolved in Kotlin 1.1.4. As of this writing, it's available as an EAP (Early Access Preview) release; the final version will be released soon (and bundled with IntelliJ IDEA 2017.2.2).

    0 讨论(0)
  • 2021-02-07 07:46

    I recently ran into this with a Kotlin gradle multi module project. I managed to get back to a good code analysis and completion speed by massively increasing my memory settings in the vmoptions, this is what they look like now

    -Xms512m
    -Xmx16384m
    -XX:ReservedCodeCacheSize=960m
    -XX:+UseConcMarkSweepGC
    -XX:SoftRefLRUPolicyMSPerMB=100
    -ea
    -XX:CICompilerCount=2
    -Dsun.io.useCanonPrefixCache=false
    -Djava.net.preferIPv4Stack=true
    -Djdk.http.auth.tunneling.disabledSchemes=""
    -XX:+HeapDumpOnOutOfMemoryError
    -XX:-OmitStackTraceInFastThrow
    -Djdk.attach.allowAttachSelf=true
    -Dkotlinx.coroutines.debug=off
    -Djdk.module.illegalAccess.silent=true
    -Dawt.useSystemAAFontSettings=lcd
    -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine
    -Dsun.tools.attach.tmp.only=true
    
    0 讨论(0)
  • 2021-02-07 07:46

    I've reached out to JetBrian and submitted a request to YouTrack. After reviewing the CPU snapshot, looks like upgrading the Kotlin plugin 1.1.4-eap which includes a major fix in performance will fix the issue. Just tried it and it worked!

    0 讨论(0)
  • 2021-02-07 07:52

    Still happens in Kotlin 1.3.50. Got resolved by disabling Add unambiguous imports on the fly in Settings > Editor > General > Auto Import

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