mill
mill copied to clipboard
Limit the number of parallel running ScalaJS linker processes
The ScalaJS linker is consuming a lot of memory. Running multiple instances in parallel can drastically reduce throughput on a system. In the worst case, this can bring the whole Mill process to a stop due to a OutOfMemory exception. Therefore we should limit the maximal number of parallel running linker processes. Meaning, we just wait and block until a slot becomes free. This should be implemented in ScalaJSWorker, which is already shared between all ScalaJsModules.
Originally posted by @lefou in https://github.com/com-lihaoyi/mill/issues/6207#issuecomment-3557004508