-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScalaJSWorkerImpl.ScalaJSLinker
can cause OOM
#4584
Comments
One solution could be to stop caching the fullLinkJS linkers since usually you don't do incremental linking there. |
I'm not sure, is it true that fullLinkJS doesnt have incremental linking? If so why does Scalajs offer caches at all? Perhaps @sjrd could chip in what we should do in Mill if the caches are getting too large? |
You can configure the linker to throw away its incremental state on every run with Compile/fullLinkJS/scalaJSLinkerConfig ~= { _.withBatchMode(true) } |
@lihaoyi The only problem is that the usual lack of scopes we have in Mill. In Sbt you have |
Yeah, without per-tasks scopes the state of the art would be to duplicate the task for Let's go with that for now. Some day we may have fancier stuff as discussed in #4595, but that's far enough into the future that we probably shouldn't wait for it |
We don't have def scalaJSFullLinkJSBatchMode: T[Boolean] = T { true } or def scalaJSBatchModeFullLinkJS: T[Boolean] = T { true }
One thing I don't understand is why our |
@HollandDM Can you try publishing locally this commit: 51bebc7 and see if it makes a difference in your project?
It seems that the problem is that we keep a global |
Having individual |
IMHO, we should move the linking toolchain into it's own trait. This follows our previous generalizations done in |
The issue with using a sub-module for |
My company has about 10
ScalaJSModule
s, each of them is quite big on their own. For simplicity in CI/CD, we create a single task thatfullLinkJS
all 10 modules seqentially. Between the run,LinkInput
does not changed, soScalaJSWorkerImpl
keeps using the same cachedLinker
andIRFileCache.Cache
.This causes OOM on our server because Scala.js's
IRFileCache.Cache
does not evict anything by itself, so the number of cached files in memory become too much.One easy solution for this is to
fullLinkJs
each module in its own mill no-server process, but this makes our CI/CD pipeline more complicated.IRFileCache.Cache
implementation in Scala.js does provide afree
method which can mitigate this problems. Can we somehow get the access to the methods? If not, can you guys provide other solutions for this problem?The text was updated successfully, but these errors were encountered: