Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting cursive debug REPL freezes IntelliJ for mintutes on end #2092

Open
awebneck opened this issue Nov 26, 2018 · 7 comments
Open

Starting cursive debug REPL freezes IntelliJ for mintutes on end #2092

awebneck opened this issue Nov 26, 2018 · 7 comments

Comments

@awebneck
Copy link

I've experienced this issue now on 2 completely separate machines. Starting the cursive debug REPL (not the non-debug REPL) freezes hard for nearly 3-4 minutes while the IntelliJ status bar echoes "calculating classpath". The entire interface is frozen in this event, and stays that way for a seriously untenable duration. I'm including the thread dump from jstack of what's going on during this period.
thread-dump.txt

@shaunparker
Copy link

shaunparker commented Jul 12, 2019

I just ran into this issue after upgrading from IntelliJ IDEA 2018.1 to 2019.1. It froze when I tried to run an existing configuration from 2018.1 with the message "Calculating Classpath". This happens when running or debugging the configuration. I let it go for a few minutes and never saw IDEA unfreeze, so I ended up killing and relaunching IDEA a bunch of times trying to figure out a solution.

The issue seems to be tied to using a run configuration from an older version of IDEA. I should note that I'm not sure what version of IDEA I was using when I created the offending run configuration, but the project was started in August of 2015.

I created a new run configuration with the same options and it ran without issue in normal and debug mode.

I took a look the .idea/workspace.xml to see the differences in the configuration. The only difference was that the old configuration contained this additional XML:

<RunnerSettings RunnerId="Debug">
  <option name="DEBUG_PORT" value="" />
  <option name="TRANSPORT" value="0" />
  <option name="LOCAL" value="true" />
</RunnerSettings>
<ConfigurationWrapper RunnerId="Debug" />

I thought that commenting out <option name="DEBUG_PORT" value="" /> resolved the issue, but after restarting IDEA it seems to still hang (perhaps I was running the new configuration). I can still run/debug the new configuration without issue. I'll keep this old configuration around in case you want to take a look at it.

@cursive-ide I hope this helps debug what might be causing the issue. Have a great weekend!

Cheers,
Shaun

@isaksky
Copy link

isaksky commented Jul 16, 2019

I'm getting the same problem, just using the normal REPL. For me it started happening after adding a dependency (aws-sdk). Also reproduced by adding other libraries instead. I've tried invalidating caches, blowing away the .idea directory, removing .m2, restarting the whole computer, but nothing works.

I can get this to happen reliably by just adding these 2 dependencies to project.clj, then starting the cursive REPL:

;; https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk
[com.amazonaws/aws-java-sdk "1.11.592"]
;; https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-s3
[com.amazonaws/aws-java-sdk-s3 "1.11.592"]

Looks like it is related to this issue:

technomancy/leiningen#2452

@kamushadenes
Copy link

kamushadenes commented Mar 9, 2021

Experiencing the same on NixOS. There isn't a high cpu load or anything that could indicate a resource issue.

@DaveWM
Copy link

DaveWM commented May 6, 2021

I'm also running into this issue on NixOS. When I launch the repl, the loading bar says "calculating classpath" for a few seconds, and then the whole IDE freezes indefinitely (I left it for 20 minutes with no change). I've changing the "how to run it" option in the config, but it doesn't have any effect. The spawned java process seems to stay running, and doesn't use a massive amount of CPU or memory. @cursive-ide sorry that's not much to go on, I'm happy to provide any details/logs you need, just let me know what would be useful.

For anyone else with this issue, you can work around it by using a remote repl instead of a local repl.

@kamushadenes
Copy link

Solved with the following:

  • Deleted .config/JetBrains/
  • Deleted all Clojure projects .idea directories
  • Use nREPL
:repl {
         :plugins [[cider/cider-nrepl "0.25.3"]                                                                                                                                                                            
                      [refactor-nrepl "2.5.0-SNAPSHOT"]]        
        ...

Use Remote instead of Local REPL on IDEA, check "nREPL" as connection type and check "Use port from nREPL file", selecting the project folder.

@andreimaxim
Copy link

Adding my $0.02 as I'm neither a Clojure developer (yet) nor an expert in IntelliJ plugins:

First, I removed all the IntelliJ-related folders (~/AppData/Local/JetBrains/IntelliJIdea2021.1 and ~/AppData/Roaming/JetBrains/IntelliJIdea2021.1) plus the ~/.lein and ~/.m2 folder in my Windows user folder in order to have a fresh Idea install and then installed only the Cursive plugin.

Then I created four projects:

  • In the default folder (Users/Andrei/IdeaProjects) with the builtin SDK (v11);
  • In the default folder (Users/Andrei/IdeaProjects) with the OpenJDK SDK (v11.0.11+9 Hotspot) from the Windows via the AdoptOpenJDK installer;
  • In a WSL 2 folder (\\wsl$\Ubuntu-20.04\home\andrei\src) with the OpenJDK SDK (v11.0.11+9 Hotspot) from the Windows via the AdoptOpenJDK installer;
  • In a WSL 2 folder (\\wsl$\Ubuntu-20.04\home\andrei\src) with the OpenJDK SDK (v11.0.11+9 Hotspot) installed via apt-get in WSL 2 via the AdoptOpenJDK repository.

In all cases I created the project using the steps described on the Cursive IDE website: New Project > Clojure > Leiningen and the SDK specified above.

The only combinations that worked involved the OpenJDK SDK installed in Windows and it resulted in a working nREPL instance. When using the builtin SDK or the WSL 2 SDK I would get the "Loading Classpath" message and Idea would freeze with minimal CPU or disk usage.

For me, as somebody who's trying to pick up Clojure, I guess installing an SDK is a good enough fix. However, I would imagine that most people (myself included) would want to be able to use the WSL 2 integration in the near future.

Let me know if I can help in any way.

@mmmdreg
Copy link

mmmdreg commented Jan 18, 2023

This typically happens when you have a lot of deps (including transitive)

To fix:

Try opening the run configuration and changing the ”shorten command line” option to eg “JAR manifest“. This worked for me (I got the hint from #1150)

Cursive could do better to catch this issue to avoid locking up the IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants