Speedup IntelliJ-Idea Speedup IntelliJ-Idea windows windows

Speedup IntelliJ-Idea


This combination works great on my Intellij13 running in Mavericks:

Updated Jul 18, 2017:

# custom IntelliJ IDEA VM options-ea-server-Xms2G-Xmx4096M-Xss2m-XX:MaxMetaspaceSize=2G-XX:ReservedCodeCacheSize=1G-XX:MetaspaceSize=512m-XX:+UseConcMarkSweepGC-XX:+DoEscapeAnalysis-XX:SoftRefLRUPolicyMSPerMB=50-XX:+UnlockExperimentalVMOptions-Djava.net.preferIPv4Stack=true-Dsun.io.useCanonCaches=false-XX:LargePageSizeInBytes=256m-XX:+UseCodeCacheFlushing-XX:ParallelGCThreads=8-XX:+DisableExplicitGC-XX:+ExplicitGCInvokesConcurrent-XX:+PrintGCDetails-XX:+PrintFlagsFinal-XX:+AggressiveOpts-XX:+CMSClassUnloadingEnabled-XX:CMSInitiatingOccupancyFraction=60-XX:+CMSClassUnloadingEnabled-XX:+CMSParallelRemarkEnabled-XX:+UseAdaptiveGCBoundary-XX:+UseSplitVerifier-XX:CompileThreshold=10000-XX:+OptimizeStringConcat-XX:+UseStringCache-XX:+UseFastAccessorMethods-XX:+UnlockDiagnosticVMOptions-XX:+HeapDumpOnOutOfMemoryError-XX:+UseCompressedOops-XX:-OmitStackTraceInFastThrow-Dawt.useSystemAAFontSettings=lcd-Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine

I keep this setting updated at https://github.com/adben/config/blob/master/idea64.vmoptions


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


Some time ago I was looking for the ways to speedup my project's compilation and that is result. This is not for IntelliJ IDEA itself but will help a lot when (re)building a big projects and, I guess, it will work with any other IDEs too. Also, I described Linux approach, but I'm sure Windows have it's own RAM-disk implementations.

The easiest way to speedup compilation is to move compilation output to RAM disk.

RAM disk setup

Open fstab

$ sudo gedit /etc/fstab

(instead of gedit you can use vi or whatever you like)

Set up RAM disk mount point

I'm using RAM disks in several places in my system, and one of them is /tmp, so I'll just put my compile output there:

tmpfs /var/tmp tmpfs defaults 0 0

In this case your filesystem size will not be bounded, but it's ok, my /tmp size right now is 73MB. But if you afraid that RAM disk size will become too big - you can limit it's size, e.g.:

tmpfs /var/tmp tmpfs defaults,size=512M 0 0

Project setup

In IntelliJ IDEA, open Project Structure (Ctrl+Alt+Shift+S by default), then go to Project - 'Project compiler output' and move it to RAM disk mount point:

/tmp/projectName/out

(I've added projectName folder in order to find it easily if I need to get there or will work with several projects at same time)

Then, go to Modules, and in all your modules go to Paths and select 'Inherit project compile output path' or, if you want to use custom compile output path, modify 'Output path' and 'Test output path' the way you did it to project compiler output before.

That's all, folks!

P.S. A few numbers: time of my current project compilation in different cases (approx):

HDD:     80sSSD:     30sSSD+RAM: 20s

P.P.S. If you use SSD disk, besides compilation speedup you will reduce write operations on your disk, so it will also help your SSD to live happily ever after ;)