Intelliji idea is very slow in debug mode and it is running perfectly in normal mode.
I already tried by setting the below thing in /etc/hosts file sudo nano /etc/hosts
I faced similar problem with the Eclipse also and found the solution. It is happening because your IntelliJ is using online Java and not using the same which is installed in your system.
You should set the java path to your system one in the IntelliJ configuration. Below link will help you for the same:
https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under
Hope this will help you. :-)