Intellij IDEA creates multiple process for each debug session?

Viewed 3044

Every time I hit the debug button in my IDE is create a new process running on the OS.

enter image description here

Is there a way to configure things so that only one JAVA process can be running on my OS at once when hitting the debug button?

What I know is if I hit the red stop button in the debugging panel that number will decrement. So long as I remember to stop before hitting the debug button each time I can manage the number of running processes. But this is easy to forget to do. In addition, once i have 5-10 running debug sessions it is very tedious to delete them all. I must go to Run->Show Running List and a list of the "VM Connections" appear and I must delete them one by one. Often this UI component that lists them will simply disappear and I must pull it out again. Is there a way to end all of these processes at once?

5 Answers

Update for Intellij IDEA

For all those who wonder that every time a second java process occur (with ca. 100 MB memory allocation) once a compile/debug/run is executed and only one instance is running: The process is the Compile Server which runs parallel to main IDEA and takes over compilation. Reason for this is lower memory footprint and performance.

The feature exists since 2012, but was not enabled by default.

All of us in the company have the IntelliJ Idea and we all faced this issue after version 2019.2.3. The solution was unexpected. as You can see in the below picture, there is an item named On frame deactivation and the default value was Update classes and resources.

In this case, when we were on debug mode and we were changing a simple thing and we were changing the current windows (for example bringing the chrome to front to test the change), for every deactivation on idea frame it was creating two processes (one for building and one for hot swap), so you can imagine how many processes you could end of with. I had personally 12 processes some times!

The answer was changing this value to Do nothing. so every time I change a class, I press the white button in debug frame manually and it does the resource refresh only one time.

We tried to change the heap size or other solution and they were ineffective for us.

enter image description here

Related