Tips for Handling large projects with Maven and In

2019-01-31 13:15发布

I was reading this blog post about the experience of a team using Intellij Idea for large maven projects and have also looked at a similar question posted around 2 years back for IDEA v.10.0.2.

One of the tips mentioned in the former made a whole lot of sense :
Move C:\Users\$user\.IntelliJIdea12 into a folder not access-scanned by the antivirus.

I have searched around for performance centric VM options and currently my idea64.exe.vmoptions looks like this :

-Xms1200m
-Xmx1200m
-XX:MaxPermSize=200m
-ea
-server
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
-XX:+UnlockExperimentalVMOptions
-XX:+UseParallelGC
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-Dsun.io.useCanonCaches=false

Questions

  1. Do you have any more such tips to improve Intellij IDEA (12.1.3, 64 bit) performance with large/huge maven projects ?

  2. Could you please share discoveries you have made w.r.t VM options in idea64.exe.vmoptions and/or IDEA configuration in idea.properties.

  3. I have tried using JDK 7 to startup IDEA but this does not seem to terribly affect it's performance one way or the other. If you have tried doing so, did you experience the same ?

3条回答
疯言疯语
2楼-- · 2019-01-31 13:23

IntelliJ IDEA 2017.2 Added really nice feature, which helps a lot when working with large projects. Basically, you can mark which modules will be loaded by IDEA and which not. Unloaded modules will not be touched in any way by the IDE. They will not be indexed, searched, they will not be subject to refactoring on inspections. Loaded/Unloaded modules can be quickly configured in Load/Unload Modules dialog. The dialog can be opened using

Project Tree window → Right Click on a file → Load/Unload Modules...

enter image description here Temporarily reducing the number of modules IDEA works with will greatly increase the performance for big projects. You can find more info about this feature and other performance tweaks for IntelliJ IDEA in a blog post I wrote: IntelliJ IDEA Tips & Tricks: Improving performance

查看更多
我只想做你的唯一
3楼-- · 2019-01-31 13:32

Sometimes you can run out of memory on a large project. An import process of the large maven project fails then.
So if any of modules of your project is underlined with a red line and you see

Exception java.lang.OutOfMemoryError: GC overhead limit exceeded

on it, go to "Settings -> Build Tools -> Maven -> Importing", and find the "VM options for importer" option there. Increase the limit, set it to -Xmx1g (or more).

(Source)

查看更多
看我几分像从前
4楼-- · 2019-01-31 13:47

As suggested by @CrazyCoder, I followed the steps on the official FAQ regarding this matter:

Common solutions for IntellJ IDEA performance problems

Specifically, the following seemed to have had an appreciable affect:

  1. Moved the c:/Users/$user/.IntelliJIdea12 to a location excluded by McAfee's on-access-scanner, and updated $INTELLJ_INSTALL_FOLDER/bin/idea.properties to point to the new location like so (where c:/dev is the folder excluded by McAfee):

    idea.config.path=c:/dev/.IntelliJIdea12/config
    idea.system.path=c:/dev/.IntelliJIdea12/system
    idea.plugins.path=c:/dev/.IntelliJIdea12/config/plugins
    idea.log.path=c:/dev/.IntelliJIdea12/system/log

  2. In $INTELLJ_INSTALL_FOLDER/bin/idea.properties set idea.jars.nocopy=true as documented in this blog post.

  3. Reverted back to the stock $INTELLIJ_INSTALL_FOLDER/bin/idea64.exe.vmoptions. The only changes that remains are those suggested in Too low heap size for a 64-bit JVM. Here is what I have in the that file currently:

    -Xms1200m
    -Xmx1200m
    -XX:+UseCompressedOops
    -XX:MaxPermSize=350m
    -XX:ReservedCodeCacheSize=96m
    -XX:+UseCodeCacheFlushing
    -ea
    -Dsun.io.useCanonCaches=false
    -Djava.net.preferIPv4Stack=true

  4. Disabled Git integration plugin since I mostly use command line Cygwin-Git.

  5. It was useful to monitor .IntelliJIdea12/idea.log. For example : I disabled the osmorc (for OSGI) plugin after seeing that it was frequently logging error while trying to opening zip files in the projects. Sample error :

    WARN - pi.vfs.impl.jar.JarHandlerBase - error in opening zip file: C:\dev\a-maven-project\pom.xml java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.(ZipFile.java:127)
    at java.util.zip.ZipFile.(ZipFile.java:143)

  6. Disabled all the plugins that I do not need. The current list of disabled plugins is :

    Disabled plugins: ASP (0.1), Android Designer, Android Support (10.0), Atlassian Connector for IntelliJ IDE (3.0.9, SVN:1212171008), Base Cucumber (1.0), BashSupport (1.1beta16), CFML Support (3.53), CheckStyle-IDEA (4.2), ClearCase Integration (2.0), Cloud Foundry integration (1.0), CloudBees integration (1.0), Commander (1.0.0), Copy as HTML (0.8.1), Cucumber for Groovy (1.0), Cucumber for Java (1.0), Database Navigator (3.0.2501), Describe Key (0.3), Drools Support (1.0), Eclipse Integration (3.0), Flash/Flex Support (1.0), GWT Support (1.0), Geronimo Integration (1.0), Git Integration (8.1), GitHub, Google App Engine Integration (1.1.4), Grep Console (1.1), GuiceyIDEA (8.0), HAML, IDEtalk (1.0), IdeaVim (0.28), Identifier Highlighter (3.62), IntelliJad Plus (0.5.6), JBoss Integration (1.0), JBoss jBPM (2.0.0), JRebel Plugin (2.0.2), JavaFX (1.0), Key promoter (1.0.11), Log4JPlugin (1.02), Markdown (0.8.3), Osmorc (1.4.3), Perforce Integration (2.0), PluginUpdateNotifier (2.0.3), RemoteTail (0.3.4), Resin Integration (8.1), Ruby (5.4.0.20130410), SQL Query Plugin (2.2), SSH Remote Run (0.1), Seam Pageflow Support (1.0), Seam Pages Support (1.0), Seam Support (1.0), SmarterEditor (0.8.3), Struts Navigator Plugin (1.3.4), Subversion Integration (1.1), TFS Integration (999.999), Tapestry support (1.0), TestNG-J (8.0), UI Designer, UI Designer (Core), Vaadin Support (1.0), Visual SourceSafe Integration (2.0), WebLogic Integration (1.0), WebSphere Integration (1.0), ZKM-Unscramble (1.0), dmServer Support (0.9.5), hg4idea (10.0), soapUI Plugin (3.5)

查看更多
登录 后发表回答