Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij IDEA freezes up, even when editing a .txt file

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

like image 554
mjs Avatar asked Sep 29 '14 11:09

mjs


People also ask

How much RAM does IntelliJ IDEA use?

Intellij Idea consumes all 8GB memory allocated for it after upgrading to 2021.1. Intellij Idea consumes all 8GB memory allocated for it after upgrading to 2021.1.

Is IntelliJ IDEA a text editor?

When you need to edit just one file without creating or loading the whole project in IntelliJ IDEA, you can use the LightEdit mode. Keep in mind that the LightEdit mode works as a text-like editor, and it doesn't support the usual IDE editor features such as code completion, or code navigation.

How do I make a file editable in IntelliJ?

To toggle read-only attribute of a file, open file in the editor, or select it in the Project tool window. Do one of the following: On the main menu, choose File | File Properties | Make File Read-Only , or Make File Writable .

Why is IntelliJ so slow?

Increase memory for IntelliJ IDEA By default, the IDE requests a maximum of 2048 MB. You can change this option in Help → Change memory settings. According to the feedback from some of our users and colleagues with big projects, changing the option to 8GB significantly improves IDE performance.


1 Answers

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.

like image 111
Javaru Avatar answered Oct 15 '22 11:10

Javaru