scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.1k stars 336 forks source link

Metals keep repeatedly trigger compilation of already compiled modules #6822

Open nafiyAix opened 1 month ago

nafiyAix commented 1 month ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Go to VSCode or Cursor extension market install metals plugin
  2. Git clone spark repository from https://github.com/apache/spark, here I'm using origin/branch-3.2
  3. Choose using mvn for metals to compile project
  4. After bloop server launched, start compiling, wait for all modules get compiled
  5. Click scala code under core module and use Go definition function on any code, it may trigger the compile again randomly. If there isn't anything happen, you can wait for a while, sometimes even there isn't any operation, metals would also trigger compilation of already compiled modules

Expected behavior

After 1st time compilation of whole project, wait for a while the metals log will show that it start to compile spark-core, spark-sql module, etc And after multiple times compilation, bloop server may OOM and stuck, and metals client would also quit.

Screenshots

image

OOM after multiple times compilations (using default JVM settings here)

image

Installation:

Additional context

Search terms

tgodzik commented 1 month ago

Thanks for reporting! Those compilations are most of the time NOP, meaning nothing actually is compiled if the source code doesn't change.

The OOM is worrying so we'll have to take a look at it.