Description
Windows 10 x64
IntelliJ IDEA 2024.1.1
IDEA plugin version 1.23.1
When starting the IDE with the plugin enabled, CPU utilization is normal.
After opening a .g4
file, CPU usage spikes and stays high.
CPU utilization continues staying high if the file is closed. It also stays high if parsing is stopped by the "stop" button in the preview pane. The preview pane does not ever need to have opened for the high utilization to start.
When setting idea64.exe affinity to just cores 0 and 2 (to avoid hyper-threading), both cores are at 100% utilization. Giving IDEA additional cores distributes the load, which suggests 2 no-sleep looping threads.
Closing the project does not cause this utilization to come back down. Only terminating the IDE and restarting causes idle utilization to be normal again.
This anomalous utilization does not occur if the plugin is disabled.
After some testing, I discovered that this does not happen to all grammars. I have created an offending grammar that causes this issue:
grammar Bad;
start: list EOF;
list: x list;
x: 'test';