DragonKnightOfBreeze / Paradox-Language-Support

IDEA Plugin: Paradox Language Support.
https://windea.icu/Paradox-Language-Support
MIT License
37 stars 4 forks source link

IntelliJ Freezes when Indexing #82

Closed kaiser-chris closed 3 weeks ago

kaiser-chris commented 1 month ago

Hi,

first of all I love this Plugin and your work.

But every plugin version after 1.3.12 freezes my IDE when indexing. When I downgrade the plugin manually it works without issues. Below are details about the issue.

IDE Version:

Plugin Settings:

Behavior:

Regards,

Chris

Decent-Name-Here commented 1 month ago

I've been having a similar issues with HOI4. Either it hangs on two specific files or just freezes midway through loading a project

other projects seem to load perfectly fine

Im not very well versed in the technical backend of this stuff but i can lend logs or whatever if needed

DragonKnightOfBreeze commented 1 month ago

Your IDE may be reinstalled, but your IDE's cache and indices may not be invalidated, try:

  1. Invalidate cache and restart
  2. Produce the freeze log (when IDE freezes wait for a minute first kill second and restart 3rd, then should get the freeze log, it's unnecessary to restart and reopen same project)

image

kaiser-chris commented 1 month ago

Ok I had previously tried invalidating cache (forgot to mention in my inital post), but I tried it again and behaviour keeps to be the same. Also in my test again I noticed it always seems to get stuck at the same file: image

Thread Dump from Freeze Logs: threadDump-20240812-041001.txt

(EDIT) File that is shown in Screenshot (If you do not have the game): log_settings_live.json

DragonKnightOfBreeze commented 1 month ago

Nothing found from above freeze logs, could thread dump log be provided when IDE is freezing? (use jstack -l <pid> command, pid of IDEA can be found in Profier tab) image

DragonKnightOfBreeze commented 1 month ago

Perhaps I should debug vic3 game directory by myself

kaiser-chris commented 1 month ago

@DragonKnightOfBreeze If you look at the logs you can see that _ParadoxScriptLexer is running. Also from my screenshot you can see that it is parsing log_settings_live.json when the UI last updated. Have you tried running that file (I attached the file, from the game folder) through your lexer by hand or putting it in another game folder to see what happens? Maybe your Paradox File Lexer runs into an infinite Loop parsing a JSON file.

Should it even try to parse a JSON file using your Paradox Script Lexer? Maybe that is the issue?

DragonKnightOfBreeze commented 1 month ago

It does not mean that, if there is _ParadoxScriptLexer in stacktrace, there is some problems in the file currently opend, shown in editor, or focused, or in the progress bar. ParadoxScriptLexer is only for paradox script files, normally *.txt files. If the freeze log is so, there may be a paradox script file, that plugin cannot normally parse it, and will cause freezing.

DragonKnightOfBreeze commented 1 month ago

How about the memory have you given to IDEA? Normally, it should be 4G+ or even 8G+. If IDEA's memory is not enough, various strange problems may be produced.

kaiser-chris commented 1 month ago

I have not configured any memory limit and my computer has 32gb ram

DragonKnightOfBreeze commented 1 month ago

Then it may be necessary to configure

kaiser-chris commented 1 month ago

It was 4gb. I set it to 8gb. Same behaviour. image

DragonKnightOfBreeze commented 4 weeks ago

Nothing found from above freeze logs, could thread dump log be provided when IDE is freezing? (use jstack -l <pid> command, pid of IDEA can be found in Profier tab) image

Could you please provide a thread dump log by jstack when IDE is freezing? You can follow this screenshot: image

kaiser-chris commented 4 weeks ago

Hi,

attached is the log: jstack.log

Edit: I created another few logs after a few minutes. It seems to have a few less threads but now the amount is stable so may want to use this one: jstack2.log

DragonKnightOfBreeze commented 3 weeks ago

Simply typing @@@ in a script file will cause this issue (ide freeze, infinite loop in lexer)

DragonKnightOfBreeze commented 3 weeks ago

Should be fixed in 1.3.18 (will be released in few days)

kaiser-chris commented 3 weeks ago

Thank you!