简体   繁体   中英

IntelliJ plugin development freezes target IntelliJ instance

I am building a very simple IntelliJ plugin, and using IntellIJ CE (2019.1) as my target for build smoke-testing/debugging, deploying via the OOTB IntelliJ Plugin Run Configuration.

Whenever I perform a Run/Debug, it opens IntelliJ CE as expected (as Main java process), lets me select a project to open. Once a project is opened and the IntelliJ UI loads, I have about 5-10 seconds before the UI becomes unresponsive and I get the spinning beachball. I notice that the Main java process (which is for the CE instance), starts to gobble up memory jumping to 5-6GB over the next few seconds (on my 16GB machine). At this point, I can't do much except stopping the process.

Initially, I thought it was my code (perhaps creating an unintentional infinite loop), but I commented everything out of my plugin.xml except a fileType extension (which is basically a Bean), and it still does it. I continued my investigation by grabbing a few other IntelliJ plugin projects from GitHub, and running those (unmodified), to the same effect!! So I don't think its anything to do w/ my plugin in particular.

I've taken thread dumps of the CE process, but nothing jumps out (specifically looking for traces that contain my packages).

Lastly, I've built the plugin as a deployable Jar, and deployed it into both CE and Ultimate, and it doesn't freeze anything up. So it appears this has something to do with the Plugin deployment RunConfiguration (which I've left w/ default params).

I'm on macOS, running the latest (as of this post) IntelliJ 2019.1. I'm developing on IntelliJ Ultimate and deploying to IntelliJ CE (2019.1).


Resolution w/ screenshots based on the selected correct answer:

  1. Create a New IntelliJ Plugin Development SDK pointing at IntelliJ CE install, and set as the Project's SDK 在此处输入图片说明

  2. Create a New JDK that points to the RJDK downloaded from bintray 在此处输入图片说明

  3. Assign the JDK created in step 2, as the JDK for the Puggin Development SDK created in Step 1 (via the SDKs tab) 在此处输入图片说明

  4. Set the Plugin Run Configuration to use the IntelliJ CE SDK. 在此处输入图片说明

  5. Run the Plugin run configuration, and CE will open with the plugin "hot deployed" to it!

Use JetBrains Runtime 8 or 11 version from https://bintray.com/jetbrains/intellij-jbr or from your main IntelliJ IDEA installation to run the sandbox IDE version. You can specify it in the JRE field of the plug-in Run/Debug configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM