Increased CPU usage, when file contains an error


today a user of my plugin brought an interesting issue to my attention. When you introduce an error in a file, the
CPU usage rises to 100%. This does not seem to happen for languages like Java or XML, so I believe it must be connected to my plugin.

Any tips how I can track the source of this issue down? Did someone already had to deal with something like this?


Comment actions Permalink

Use YourKit to capture a CPU snapshot, and you'll see what exactly happens and what takes the time.

Comment actions Permalink

As alwasy Dmitry, thank you very much. I could track the source down. It is one specific inspections that eats a lot of the CPU when there is an error in the file. It's pretty weird, because the inspection runs all the time. Since it goes only crazy when there is an error, my only explanation is that the error-containing PSI seems to make things different. Had no time to look really close, but I will.

Thank you.
I really appreciate all your help.


Please sign in to leave a comment.