18

When I return to intellij, sometimes just to edit an already open .txt file, Intellij would freeze and I get pissed at waiting for 3-4 seconds.

Sometimes, in Java files this happens all the time. And I would have to restart Intellij. Autocompletion is sometimes a ****.

I have a super computer, ala NSA, no just kidding, but it is a powerful beast, and Intellij properties have been altered:

-server
-Xms2048m
-Xmx4096m
-XX:MaxPermSize=2048m
-XX:ReservedCodeCacheSize=2048m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseCodeCacheFlushing
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=200
-Dawt.useSystemAAFontSettings=lcd

Various plugins have been disabled, including hg4xxx.

What is the dealio? I am on Intellij 13

mjs
  • 21,431
  • 31
  • 118
  • 200
  • Once I had this problem of Idea freezing over and over again. I finally found out that it was because the 32 bit version was running instead of 64 bit. Please make sure you have the right one running (go to ...\IntelliJ IDEA 2016.2\bin). – Fatima Oct 05 '16 at 14:44

1 Answers1

24

I would recommend dropping your memory settings down. When memory options are set too high you get pauses due to garbage collection and other memory management issues. Over the years in the BSO days (Before StackOverflow), the JetBrains IntelliJ IDEA forum routinely had some post an issue with brief hangs that ended up being solved by them dropping their memory settings down. At one point, IDEA even opened a warning popup on start-up if the more than 700MB of memory was allocated.

For the past 7 years of 10 years of IDEA usage I have run IDEA using:

-Xms128m
-Xmx724m
-XX:PermSize=128m
-XX:MaxPermSize=384m
-XX:ReservedCodeCacheSize=96m

And I frequently have numerous large projects open and have no performance issues. With that said, a recent change to the scala plug-in (at least for the EAP version of IDEA 14) suggests increasing both -Xms & -Xmx to 2048m. I've only just implemented that myself yesterday. So I need to see if it causes any issues.

If changing memory settings does not resolve the issue, I would recommend disabling all third-party (i.e. non-bundled) plug-ins to ensure that is not an issue. (They often are.) If that resolves it, you can track down which particular plug-in is causing the issue.

Another culprit that can cause this issue is anti-virus software. IDEA uses a lot of cache and index files that are updated frequently. JetBrains recommends you add the IDEA system and config directories from anti-virus real time monitoring. See Directories used by the IDE to store settings, caches, plugins and logs for their locations.

In regards to the pauses upon frame reactivation, you may want to turn off File > Settings (Ctrl+Alt+S) > [IDE Settings] > General > Synchronization > Synchronize files on frame deactivation. Usually it's not a problem to have this turned on. But on some systems it might cause an issue. Be aware however if you routinely edit project files outside of IDEA, you need to be more cautions and manually run a File Synchronization when you return to IDEA.

If after that the issue persists, I recommend you take a CPU and Memory Snapshot (as outlined in the linked document) and submit them to JetBrains.

Javaru
  • 30,412
  • 11
  • 93
  • 70
  • 1
    Thanks for your input. Yes, I had disabled the synchronization, but still occured. Now it has been resolved after disabling a bunch of plugins, so I am uncertain what resolved it. However, I believe it was the auto parse delay setting. I am not sure what the default is but I believe mine was too low, i have increased it to 500. What is yours? – mjs Sep 30 '14 at 16:38
  • I assume you mean the Error Highlighting `Autoreparse delay` setting. The default is 300ms. I have mine set to 500ms. Going a bit longer might help on an extremely large project. – Javaru Sep 30 '14 at 17:46